Hi, I have encountered this problem.

Traceback (most recent call last):
File “main.py 17”, line 67, in 
network.train()
File “/home/sp/text-classification-cnn/network/cnnTextNetwork.py”, line 115, in train
logit = self.model(feature)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “/home/sp/text-classification-cnn/model/cnnText/cnntext.py”, line 48, in forward
x = [F.relu(conv(x)).squeeze(3) for conv in self.convs1]
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/conv.py”, line 237, in forward
self.padding, self.dilation, self.groups)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py”, line 39, in conv2d
return f(input, weight, bias)
RuntimeError: tensors are on different GPUs

Even I specify the device in the env:

CUDA_VISIBLE_DEVICES=0 python main.py 17

and it doesn’t work.
Anyone can help me out of this…
Thanks.