问题原因:非分布式训练使用了分布式训练的设置
两种解决办法:
1、在tools/train.py 中加入
import torch.distributed as dist
dist.init_process_group('gloo', init_method='file:///temp/somefile', rank=0, world_size=1)
2、在configs/_base_/models 的文件中,首行norm_cfg = dict(type='SyncBN', requires_grad=True), 'SyncBN'是采用distributed的训练方法,在单GPU non-distributed训练中使用会出现上述错误,
改为type='BN' 即可.