AdelaiDet icon indicating copy to clipboard operation
AdelaiDet copied to clipboard

RuntimeError: Default process group has not been initialized, please make sure to call init_process_group.

Open km1562 opened this issue 3 years ago • 2 comments

when I use single GPU, the ABC will produce the error, I find the answer on the Internet, it's the reason that ABC use the synbatchnorm, So, when use the single GPU, you need to init the process_group, maybe you can updata the code to main ———————————————————— image

—————————————————————— cuda_num = os.environ['CUDA_VISIBLE_DEVICES'] cuda_num_list = list(cuda_num.split(",")) if len(cuda_num_list) == 1: import torch.distributed as dist

  dist.init_process_group(backend='nccl', init_method='tcp://localhost:23456', rank=0, world_size=1)
  print("already init\n")

km1562 avatar Dec 12 '21 08:12 km1562

Update the solution worked on colab cuda_num = os.environ['CUDA_VISIBLE_DEVICES'] casue keyerrors so i manually changed cuda_num="0"

cuda_num_list = list(cuda_num.split(",")) if len(cuda_num_list) == 1: import torch.distributed as dist

kimile599 avatar May 24 '22 03:05 kimile599