It works for me when running the tutorial codes of nn.DataParallel from Pytorch.
However in my code it doesn’t work.:
CUDA_VISIBLE_DEVICEs=1,3,4 python train.py
GPU_COUNT = torch.cuda.device_count() # 3
device = torch.device("cuda")
model.load_weights(model_path)
model = torch.nn.DataParallel(model)
model.to(device)

However when monitoring the memory thru terminal, model is only loaded into the first GPU
Any Solution?