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

RuntimeError: bool value of Tensor with more than one value is ambiguous #13

Open
chandreshiit opened this issue Jun 12, 2018 · 1 comment

Comments

@chandreshiit
Copy link

chandreshiit commented Jun 12, 2018

While running your code, I encountered this error.

Traceback (most recent call last):
  File "nmt.py", line 181, in <module>
    decoder_logit = model(input_lines_src, input_lines_trg)
  File "/home/cmaurya1/code/py2.7/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/cmaurya1/code/seq2seq/seq2seq_maximum_entropy/model.py", line 841, in forward
    ctx_mask
  File "/home/cmaurya1/code/py2.7/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*in
Traceback (most recent call last):
  File "nmt.py", line 181, in <module>
    decoder_logit = model(input_lines_src, input_lines_trg)
  File "/home/cmaurya1/code/py2.7/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/cmaurya1/code/seq2seq/seq2seq_maximum_entropy/model.py", line 841, in forward
    ctx_mask
  File "/home/cmaurya1/code/py2.7/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/cmaurya1/code/seq2seq/seq2seq_maximum_entropy/model.py", line 382, in forward
    output.append(isinstance(hidden, tuple) and hidden[0] or hidden)
RuntimeError: bool value of Tensor with more than one value is ambiguous

Any hint to solve?

@sjy1203
Copy link

sjy1203 commented Jun 15, 2018

@chandu8542
I just change this line in my case as follows:
output.append(hidden[0])

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

2 participants