I also meet this problem.I think before you use nn.DataParallel(model,device_ids = [0,1,2,3]),you should initial model by using “model.cuda()”.so the complete sentence is
model.cuda()
model = nn.DataParallel(model,device_ids = [0,1,2,3])