microsoft / Swin-Transformer

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows".
https://arxiv.org/abs/2103.14030
MIT License
13.29k stars 2.02k forks source link

Swin Transformer training and evaluation script: error: the following arguments are required: --local_rank #342

Open hailuoS opened 6 months ago

hailuoS commented 6 months ago

Hello, I used the following command to train "python -m torch.distributed.launch --nproc_per_node 8 --master_port 12345 main.py --cfg configs/swin/swin_tiny_patch4_window7_224.yaml --batch-size 128 --fused_window_process --fused_layernorm --optim=fused_adam --data-path /home/datasets/imagenet" but got "Swin Transformer training and evaluation script: error: the following arguments are required: --local_rank",how can I fix this problem, thanks

LvQiangWen commented 6 months ago

I have the same error, sad. Have you solved this problem? 微信截图_20231220205551

BitCalSaul commented 5 months ago

hi @hailuoS @LvQiangWen did you find the answer

wjyshuai commented 4 months ago

I have resolved this issue and have conducted distributed training tests on both PyTorch 1.8 and 1.10 versions. I mainly made some code deletions to main.py and config.py. Specific: '''python Delete lines 72-73 of code from main.py Delete lines 341-344 of code from config.py, then add config.LOCAL-RANK=int (os. environment ['LOCAL-RANK ']) ''' The above is my solution, I hope it will be useful to you.

wjyshuai commented 4 months ago

hi @hailuoS @LvQiangWen did you find the answer

You can try my method.

BitCalSaul commented 4 months ago

hi @hailuoS @LvQiangWen did you find the answer

You can try my method.

Bro, thanks for your reply. i solved this issue but still appreciate it :)