Hello,I meet a question about DataParallel.I want to use the GPU on the server,which ID is 0 and 3.
Traceback (most recent call last):
File “Train_gpu.py”, line 67, in 
train()
File “Train_gpu.py”, line 19, in train
model=DataParallel(model,device_ids=[0,3]).to(calculator)
File “/home/wangxu/miniconda3/envs/pt2/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py”, line 102, in init
_check_balance(self.device_ids)
File “/home/wangxu/miniconda3/envs/pt2/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py”, line 17, in _check_balance
dev_props = [torch.cuda.get_device_properties(i) for i in device_ids]
File “/home/wangxu/miniconda3/envs/pt2/lib/python2.7/site-packages/torch/cuda/init.py”, line 292, in get_device_properties
raise AssertionError(“Invalid device id”)
AssertionError: Invalid device id
And, calculator = device(‘cuda’)
When I change device_ids to [0],the code work.
So I am still confused about how to use DataParallel.The offical example on github doesn’t help.