"type": "python", "request": "launch", // 设置 program 的路径为 torchrun 脚本对应的绝对路径 "program": "/home/tim/anaconda3/envs/project/lib/python3.8/site-packages/torch/distributed/run.py", // 设置 torchrun 命令的参数 "args":[ "--nnodes", "1", "--nproc-per-node", "2", ...
{ "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "justMyCode": true, # 是否调试调用的官方库代码。若设置为false,单步调试会进入pytorch库的源码 "cwd": <启...
{"version":"0.2.0","configurations":[{"name":"Python: Current File","type":"python","request":"launch","script":"${file}","console":"integratedTerminal","cwd":"${workspaceFolder}"// 这里是起始路径的配置}]} 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 在上面的配置中...
"type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "justMyCode": true, "cwd": "${workspaceFolder}", "env": {}, "args": [] } ]}"name":配置的名称,用于在调试面板中选择启动。
在Vscode中设置cwd(当前工作目录)可以通过以下步骤完成: 1. 打开Vscode编辑器,并确保已安装了"VS Code"插件。 2. 在Vscode的顶部菜单栏中选择"文件",然后选择"首选...
{"version":"0.2.0","configurations":[{"name":"Python Debug","type":"python","request":"launch","program":"${workspaceFolder}/<your_python_script>.py","cwd":"${workspaceFolder}"}]} 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
{ //python train.py configs/path_to_your_config"name":"vil100-pld-orgin", //name 可以自己取"type":"python","request":"launch","program":"/home/yq/math/DeepBDC-main/pretrain.py","console":"integratedTerminal","cwd":"/home/yq/math/DeepBDC-main", // current workdir"args": ["-...
linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "internalConsole", "cwd": "${fileDirname}" // 设置相对路径,在debug时可以切换到当前文件所在的目录 }, { "name":...
这个文件位于项目根目录的.vscode文件夹中。如果没有这个文件,可以手动创建一个。接下来,需要编辑launch.json文件,添加或修改configurations部分。以下是一个示例配置:{"version": "0.2.0","configurations": [ {"name": "Python: Current File","type": "python","request": "launch","cwd"...
第一步,打开要进行调试的Python文件; 第二步,选择调试视图(在侧边栏中点击调试图标,或按下Ctrl+Shift+D键),然后点击调试视图右上角的齿轮图标,进入调试配置; 第三步,点击“添加配置”按钮并选择“Python”作为调试环境; 第四步,根据需要选择合适的配置参数,比如program、cwd、args等; ...