FutureWarning: The module torch.distributed.launch is deprecated
and will be removed in future. Use torchrun.
Note that --use_env is set by default in torchrun.
If your script expects `--local_rank` argument to be set, please
change it to read from `os.environ['LOCAL_RANK']` instead. See
train.py: error: unrecognized arguments: --local_rank=0
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 2) local_rank: 0 (pid: 35585) of binary: /home/lvying/anaconda3/envs/sigma/bin/python
NCCL_P2P_DISABLE=1 CUDA_VISIBLE_DEVICES="0,1" python -m torch.distributed.launch --nproc_per_node=2 --master_port 29502 train.py -p 29502 -d 0,1
08 13:14:46 PyTorch Version 1.13.1+cu117
usage: train.py [-h] [-d DEVICES] [-c FILE] [--local-rank LOCAL_RANK] [-p PORT] [--dataset_name DATASET_NAME]
Solution:
after torch1.9,use torchrun!!!
CUDA_VISIBLE_DEVICES="0,1" torchrun --nproc_per_node=2 --master_port 29502 train.py -p 29502 -d 0,1