解决RuntimeError: module must have its parameters and buffers on device cuda:1 (device_ids[0]) but found one of them on device: cuda:2问题
model = nn.DataParallel(self.net_G, device_ids=[1,3,0,2])
device = torch.device("cuda:1")//在这里指定cuda:X X的值为报错提示的cuda:1 (device_ids[0])
model.to(device)