IBM / pytorch-seq2seq

An open source framework for seq2seq models in PyTorch.
https://ibm.github.io/pytorch-seq2seq/public/index.html
Apache License 2.0
1.5k stars 376 forks source link

Integration test fails on GPU #160

Closed pskrunner14 closed 6 years ago

pskrunner14 commented 6 years ago

Integration test in scripts/integration_test.py fails with the following stacktrace:

Traceback (most recent call last):
  File "scripts/integration_test.py", line 115, in <module>
    seq = predictor.predict(inp_seq.split())
  File "/home/psk/.local/lib/python3.6/site-packages/seq2seq-0.1.6-py3.6.egg/seq2seq/evaluator/predictor.py",line 44, in predict
  File "/home/psk/.local/lib/python3.6/site-packages/seq2seq-0.1.6-py3.6.egg/seq2seq/evaluator/predictor.py",line 30, in get_decoder_features
  File "/home/psk/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/psk/.local/lib/python3.6/site-packages/seq2seq-0.1.6-py3.6.egg/seq2seq/models/seq2seq.py", line53, in forward
  File "/home/psk/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/psk/.local/lib/python3.6/site-packages/seq2seq-0.1.6-py3.6.egg/seq2seq/models/TopKDecoder.py", line 131, in forward
  File "/home/psk/.local/lib/python3.6/site-packages/seq2seq-0.1.6-py3.6.egg/seq2seq/models/DecoderRNN.py", line 96, in forward_step
  File "/home/psk/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/psk/.local/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 113, in forward
    self.norm_type, self.scale_grad_by_freq, self.sparse)
  File "/home/psk/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 1151, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of backend CUDA but got backend CPU for argument #3 'index'
pskrunner14 commented 6 years ago

Changes from #123 fixed the bug. Integration test passes.