Attribute Error: ‘XXX‘ object has no attribute ‘module‘

if you’re training the model with

torch.nn.DataParallel

encapsulates the model

then please set multiple GPU

CUDA = '0,1'
os.environ['CUDA_VISIBLE_DEVICES'] = CUDA

Read More: