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

train.py: error: unrecognized arguments: --local-rank=0 #134

Open
davidvct opened this issue Jan 23, 2024 · 3 comments
Open

train.py: error: unrecognized arguments: --local-rank=0 #134

davidvct opened this issue Jan 23, 2024 · 3 comments

Comments

@davidvct
Copy link

davidvct commented Jan 23, 2024

Encounter this error when trying to train GoPro datasets:
python -m torch.distributed.launch --nproc_per_node=1 --master_port=4321 train.py -opt options/train/GoPro/NAFNet-width32.yml --launcher pytorch

I searched the train.py, there is no --local-rank=0.

How to fix?

@txy00001
Copy link

在train里添加
image

@sentinel8b
Copy link

sentinel8b commented Apr 24, 2024

Change

parser.add_argument('--local_rank', type=int, default=0)

To

parser.add_argument('--local-rank', type=int, default=0)

And I didn't add

os.environ['RANK'] = str(0)

@FogSue
Copy link

FogSue commented May 10, 2024

Change

parser.add_argument('--local_rank', type=int, default=0)

To

parser.add_argument('--local-rank', type=int, default=0)

And I didn't add

os.environ['RANK'] = str(0)

thanks,when i try to use torchrun it reported:”can not open python:no such file“,when i follow your change,it works!

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