配置显卡号以及source root
"configurations": [
{
"name": "Python: xx.py",
"type": "python",
"request": "launch",
"program": "xx.py", # 程序全局路径
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"CUDA_VISIBLE_DEVICES":"1", #设置使用显卡id
"PYTHONPATH":"xxxx/" # 设置source root,防止自己写的文件import后访问不到
},
},