Have you converted the model to a CUDA model?
Maybe in that one line code, you could edit this:
net = torch.nn.DataParallel(model.cuda(), device_ids=[0,1])
AFAIK, you can’t use DataParallel if the model is on the CPU.