Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

most of the testunit in tests package can't pass #143

Open
gameking157 opened this issue May 13, 2018 · 0 comments
Open

most of the testunit in tests package can't pass #143

gameking157 opened this issue May 13, 2018 · 0 comments

Comments

@gameking157
Copy link

gameking157 commented May 13, 2018

I have donwloaded the lastest version of seq2seq, but most of the testunit in tests package can't pass

image

for example run the test_topkdecoder.py
Error
Traceback (most recent call last):
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/home/wds/codes/pytorch-seq2seq/tests/test_topkdecoder.py", line 31, in test_k_1
output, _, other = decoder()
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 156, in forward
function=function)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 96, in forward_step
embedded = self.embedding(input_var)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 108, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py", line 1076, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.LongTensor but found type torch.cuda.LongTensor for argument #3 'index'

run test_decoder_rnn.py

Launching unittests with arguments python -m unittest /home/wds/codes/pytorch-seq2seq/tests/test_decoder_rnn.py in /home/wds/codes/pytorch-seq2seq/tests

Error
Traceback (most recent call last):
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/home/wds/codes/pytorch-seq2seq/tests/test_decoder_rnn.py", line 53, in test_dropout_WITH_NON_ZERO_PROB
output1, _, _ = rnn()
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 156, in forward
function=function)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 96, in forward_step
embedded = self.embedding(input_var)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 108, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py", line 1076, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.LongTensor but found type torch.cuda.LongTensor for argument #3 'index'

Error
Traceback (most recent call last):
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/home/wds/codes/pytorch-seq2seq/tests/test_decoder_rnn.py", line 41, in test_dropout_WITH_PROB_ZERO
output1, _, _ = rnn()
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 156, in forward
function=function)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 96, in forward_step
embedded = self.embedding(input_var)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 108, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py", line 1076, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.LongTensor but found type torch.cuda.LongTensor for argument #3 'index'

Error
Traceback (most recent call last):
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/home/wds/codes/pytorch-seq2seq/tests/test_decoder_rnn.py", line 30, in test_input_dropout_WITH_NON_ZERO_PROB
output1, _, _ = rnn()
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 156, in forward
function=function)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 96, in forward_step
embedded = self.embedding(input_var)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 108, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py", line 1076, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.LongTensor but found type torch.cuda.LongTensor for argument #3 'index'

Error
Traceback (most recent call last):
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/home/wds/.conda/envs/pytorch/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/home/wds/codes/pytorch-seq2seq/tests/test_decoder_rnn.py", line 18, in test_input_dropout_WITH_PROB_ZERO
output1, _, _ = rnn()
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 156, in forward
function=function)
File "/home/wds/codes/pytorch-seq2seq/seq2seq/models/DecoderRNN.py", line 96, in forward_step
embedded = self.embedding(input_var)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 108, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/wds/.conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py", line 1076, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.LongTensor but found type torch.cuda.LongTensor for argument #3 'index'

Ran 4 tests in 3.844s

FAILED (errors=4)
Process finished with exit code 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant