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
        }
    ]
}

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

相关推荐
神气龙1 小时前
VS Code连接wsl上Conda虚拟环境,打开Jupyter Notebook
ide·python·jupyter
Heigl swift2 小时前
[react工程]算法流程图编辑器
react.js·编辑器·流程图
ygqygq215 小时前
让 AI 编程助手更智能:Turbo AI Rules 扩展使用指南
vscode·ai·扩展·rules
爱吃泡芙的小白白17 小时前
如何在现有配置好环境的Pycharm中安装jupyterlab这个工具
ide·python·pycharm·notebook·虚拟环境·jupyterlab
Michael_lcf19 小时前
WebStorm配置与插件
ide·webstorm
Lv11770081 天前
初识Visual Studio中的 WinForm
开发语言·ide·笔记·c#·visual studio
Qhumaing1 天前
解决因为jupyter notebook修改路径下没有c.NotebookApp.notebook_dir而无法修改目录问题
ide·python·jupyter
南_山无梅落1 天前
PyCharm 安装了库却无法 Alt + Enter 导入?(简洁排查版)
ide·python·pycharm·虚拟环境·alt·enter·.venv
invicinble1 天前
透视IDEA,IDEA认识到什么程度算精通
java·ide·intellij-idea