Loading...

.sh文件

1
python -m torch.distributed.run --nproc_per_node=1 --master_port=2564 train.py --cfg-path lavis/projects/blip2/train/pretrain_stage1.yaml 

launch.json文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"version": "0.2.0",
"configurations": [

{
"name": "Python: Distributed Torch",
"type":"debugpy",
"request": "launch",
"program": "/root/anaconda3/envs/ab/lib/python3.9/site-packages/torch/distributed/run.py",
//"module": "torch.distributed.run",
"console": "integratedTerminal",
"args": [
"--nproc_per_node","1",
"--master_port","2564",
"/cyb/LAVIS/train.py",
"--cfg-path","cyb/LAVIS/lavis/projects/blip2/train/pretrain_stage1.yaml"
]
}
]
}

3.14日更–增加指定GPU选择

.sh文件如下:

1
CUDA_VISIBLE_DEVICES=1 python -m torch.distributed.run --nproc_per_node=1 --master_port=2564 train.py --cfg-path lavis/projects/blip2/train/pretrain_stage1.yaml 

launch.json文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"version": "0.2.0",
"configurations": [

{
"name": "Python: stage1",
"type":"debugpy",
"request": "launch",
"program": "/root/anaconda3/envs/ab/lib/python3.9/site-packages/torch/distributed/run.py",
//"module": "torch.distributed.run",
"console": "integratedTerminal",
"env": {
"CUDA_VISIBLE_DEVICES": "1"
},
"args": [
"--nproc_per_node","1",
"--master_port","2564",
"/cyb/LAVIS/train.py",
"--cfg-path","cyb/LAVIS/lavis/projects/blip2/train/pretrain_stage1.yaml"
]


}
,

{
"name": "Python: stage2",
"type":"debugpy",
"request": "launch",
"program": "/root/anaconda3/envs/ab/lib/python3.9/site-packages/torch/distributed/run.py",
//"module": "torch.distributed.run",
"console": "integratedTerminal",
"env": {
"CUDA_VISIBLE_DEVICES": "1"
},
"args": [
"--nproc_per_node","1",
"--master_port","256",
"/cyb/LAVIS/train.py",
"--cfg-path","/cyb/LAVIS/lavis/projects/blip2/train/pretrain_stage2.yaml"
]


}
]
}