Hi, all,
I met following error when using parallel_model = nn.DataParallel(model). Running on one GPU is fine.
Traceback (most recent call last):
File “main_m.py”, line 113, in
train(epoch, train_batch_logger, train_loader)
File “main_m.py”, line 47, in train
end_point = parallel_model(sample)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 489, in call
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/parallel/data_parallel.py”, line 143, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/parallel/data_parallel.py”, line 153, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File “/usr/local/lib/python2.7/dist-packages/torch/nn/parallel/parallel_apply.py”, line 83, in parallel_apply
raise output
RuntimeError: arguments are located on different GPUs at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:253
My pytorch version is v1.0. I checked all previous similar topics, none of them works for my issue. Any clue to solve this problem?