VSCode中调试通过torchrun实现的分布式训练启动程序

train.sh文件实现torchrun如下

bash 复制代码
#!/bin/bash

py3clean ./
CUDA_VISIBLE_DEVICES=3 torchrun --nproc_per_node=1 --master_port=9006 tools/train.py \
                        configs/basicvsr_plusplus_vimeo90k_bd.py \
                        --seed 0 \

需要进行更改来DeBug,改成launch.json如下所示,怎么打开launch.json百度一下

bash 复制代码
{
    "version": "0.2.0",
    "configurations": [
        {
            "python":"${command:python.interpreterPath}",
            "name": "Debug Training Script",
            "type": "python",
            "request": "launch",
            "program": "tools/train.py",
            "args": [
                "--seed",
                "0",
                "configs/basicvsr_plusplus_vimeo90k_bd.py"            
            ],
            
            "cwd": "${workspaceFolder}",
            "env": {
                "CUDA_VISIBLE_DEVICES": "3"
            },
            "console": "integratedTerminal",
            "stopOnEntry": false,

            "justMyCode": false
        }
    ]
}

然后打开如下窗口,点击这个按钮开始调试

相关推荐
啊湘12 小时前
vscode 使用 github (适用CURSOR等使用)
ide·vscode·github·cursor·mcp
从此不归路14 小时前
FPGA 结构与 CAD 设计(第3章)下
ide·fpga开发
云堆客栈15 小时前
基于vscode的markdown编辑器部署方案
ide·vscode·编辑器
smileNicky15 小时前
Lombok @Data 在 IDEA 中运行报错解决方案
java·ide·intellij-idea
好大哥呀15 小时前
C++ IDE
开发语言·c++·ide
OpenMiniServer15 小时前
AI + GitLab + VSCode:下一代开发工作流的革命性集成
人工智能·vscode·gitlab
滑稽的15 小时前
sublime merge汉化
编辑器·sublime text
dust_and_stars15 小时前
ubuntu24 安装vscode
ide·vscode·编辑器
向上的车轮16 小时前
如何选择Python IDE?
开发语言·ide·python
Destiny_where16 小时前
Claude VSCode插件版接入强大的GLM(无需登录注册claude code)
ide·人工智能·vscode·编辑器·claude code