Skip to content

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

Description

@chandreshiit

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions