Hi, @ptrblck, I use the code below:
device = torch.device("cuda", gpu_ids[0]) if args.gpu_ids is not None else torch.device("cuda")
x = imgs.to(device = device, dtype = torch.float32)
net = torch.nn.DataParallel(net, device_ids = gpu_ids, output_device = device).to(device=device)

I got the same error. Could you help?
If I comment out the DataParallel part, the code works fine