MMSeg错误:RuntimeError: Default process group has not been initialized

在使用mmSegmentation框架时遇到的问题:

File "C:\software\Anaconda3\envs\python36\lib\site-packages\torch\distributed\distributed_c10d.py", line 347, in _get_default_group
    raise RuntimeError("Default process group has not been initialized, "
RuntimeError: Default process group has not been initialized, please make sure to call init_process_group.


经调试定位,发现是一个卷积模块的normalization出现了问题:

       

 self.linear_fuse = ConvModule(
            in_channels=embedding_dim*4,
            out_channels=embedding_dim,
            kernel_size=1,
            norm_cfg=dict(type='SyncBN', requires_grad=True)
          
        )


这里的norm_cfg中,如果是多卡训练,采用“SyncBN”; 如果是单卡训练,将type修改为'BN'即可。
————————————————
来源:https://blog.csdn.net/qq_33854260/article/details/120409511

你可能感兴趣的:(掉过的坑,AI/ML/DL,MMSeg)