@rvarm1 ,
I am trying to run torch code on vscode on Ubuntu. The code is running on Ubuntu.
I am experiencing the following issue:
Exception has occurred: ProcessRaisedException


-- Process 0 terminated with the following error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
    fn(i, *args)
  File "/home/smb/code_python/pytorch-image-models/train.py", line 523, in main
    torch.distributed.init_process_group(backend='nccl', init_method='env://')
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/distributed_c10d.py", line 520, in init_process_group
    store, rank, world_size = next(rendezvous_iterator)
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/rendezvous.py", line 199, in _env_rendezvous_handler
    store = TCPStore(master_addr, master_port, world_size, start_daemon, timeout)
RuntimeError: Address already in use
  File "/home/smb/code_python/pytorch-image-models/train.py", line 1089, in <module>
    mp.spawn(main, nprocs=2, args=(2, [333,444,555]))

I set the env like this:
            "env": {
                "CUDA_VISIBLE_DEVICES": "6,7",
                "WORLD_SIZE": "2",
                "RANK": "0",
                "MASTER_ADDR": "127.0.0.1",
                "MASTER_PORT": "44147",
            }

mp.spawn(main, nprocs=2, args=(2, [333,444,555]))

args = parser.parse_args()

def main(process_index, process_cnt:int, args_spawn:list=[]):

	args.device = 'cuda:%d' % args.local_rank
	torch.cuda.set_device(args.local_rank)
	torch.distributed.init_process_group(backend='nccl', init_method='env://')
	args.world_size = torch.distributed.get_world_size()
	args.rank = torch.distributed.get_rank()