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

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

4 participants