vscode除錯分散式程式碼
阿新 • • 發佈:2022-03-23
命令列:
CUDA_VISIBLE_DEVICES=0 python -m torch.distributed.launch --nproc_per_node 1 --master_port 12345 main.py --eval --cfg configs/swin_base_patch4_window7_224_22kto1k_finetune.yaml --resume pretrained/swin_base_patch4_window7_224_22kto1k.pth --data-path /home/teamlq/workspace/wangjian/wangjian_dataset/Imagenet/
vscode除錯
修改launch.json檔案如下:
{
// 使用 IntelliSense 瞭解相關屬性。
// 懸停以檢視現有屬性的描述。
// 欲瞭解更多資訊,請訪問: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: 當前檔案",
"type": "python",
"request": "launch",
"program": "/home/teamlq/.conda/envs/swintransformer/lib/python3.8/site-packages/torch/distributed/launch.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"--nproc_per_node",
"1",
"--master_port",
"12345",
"main.py",
"--eval",
"--cfg",
"configs/swin_base_patch4_window7_224_22kto1k_finetune.yaml",
"--resume",
"pretrained/swin_base_patch4_window7_224_22kto1k.pth",
"--data-path",
"/home/teamlq/workspace/wangjian/wangjian_dataset/Imagenet/"
],
"env": {"CUDA_VISIBLE_DEVICES":"5"},
}
]
}