1、安装python插件
直接在插件商店搜索python下载自动安装。
2、配置debug json文件
点击debug中的设置会自动创建.vscode文件夹里面包含launch.json文件,在文件中添加
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true
比如:
{
"name": "train",
"type": "python",
"request": "launch",
"program": "....../tools/train.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"....../train_config.py",
"--gpus",
"1",
"--work-dir",
"./temp"
]
}