Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hailuoS opened this issue Dec 19, 2023 · 8 comments

Comments

@hailuoS
Copy link

hailuoS commented Dec 19, 2023

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
Copy link

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

@BitCalSaul
Copy link

hi @hailuoS @LvQiangWen did you find the answer

@wjyshuai
Copy link

wjyshuai commented Feb 27, 2024

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
Copy link

hi @hailuoS @LvQiangWen did you find the answer

You can try my method.

@BitCalSaul
Copy link

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 :)

@GuoST9
Copy link

GuoST9 commented Sep 12, 2024

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 :)

hi ,bro ,so how did you solve your problem, the method mentioned above can't solve my error

@wjyshuai
Copy link

@GuoST9 What software environment are you using? Can you provide detailed information? You can also send it through email [email protected] contact me.

@GuoST9
Copy link

GuoST9 commented Sep 15, 2024

@GuoST9 What software environment are you using? Can you provide detailed information? You can also send it through email [email protected] contact me.

thank you bro, I've solved my problem through adding the "--cfg myconfigs_directory" to Configurations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants