第一步:创建launch.json文件
第二步:配置launch.json文件
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {"CUDA_VISBLE_DEVICES": "0"},
"args":["--xxx","xxx", "--yyy","yyy"], #这里就是需要添加的调试参数
"justMyCode": true
}
]
}
如下图所示,配置好后就可以进行断点调试了!