AttributeError: ‘DataParallel‘ object has no attribute ‘encoder‘
错误原因这是使用nn.DataParallel产生的错误,DataParallel或DistributedDataParallel产生的错误。从它的源码中就能看出来:classDataParallel(Module):def__init__(self,module,device_ids=None,output_device=None,dim=0):super(DataParallel,self).