I'm trying to get this code running using FloydHub's GPU. When I run the train.py script under train_model folder, I'm getting the RuntimeError mentioned.
Here is the full traceback:
Traceback (most recent call last):
File "./train_model/train.py", line 79, in
answer = model(batch)
File "/usr/local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/floyd/home/train_model/model.py", line 29, in forward
vecs = self.embed(batch.text)
File "/usr/local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 110, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/usr/local/lib/python3.6/site-packages/torch/nn/functional.py", line 1110, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #3 'index'
I understand that parts of code are using GPU and other parts aren't but not knowing how to identify these and get all of the code to run on GPU.
Please help!