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

How to use multiple GPUs to train and test the network? #11

Closed
lhc11171552 opened this issue May 21, 2021 · 3 comments
Closed

How to use multiple GPUs to train and test the network? #11

lhc11171552 opened this issue May 21, 2021 · 3 comments

Comments

@lhc11171552
Copy link

I used two GPUs to train the network, and was an error: ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable RANK expected, but not set

@michuanhaohao
Copy link
Collaborator

CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=4 --master_port 66666 train.py --config_file configs/VehicleID/vit_transreid_stride.yml MODEL.DIST_TRAIN True

Sometimes you may encounter some errors because of the cuda driver. Please run the shell again after killing CUDA pids (if necessary).

@michuanhaohao
Copy link
Collaborator

Two gpus:

CUDA_VISIBLE_DEVICES=0,1
--nproc_per_node=2
Batch size * 2

@lhc11171552
Copy link
Author

Thanks,I will have a try

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

3 participants