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 with dot product #6

Open
liperrino opened this issue Feb 8, 2019 · 0 comments
Open

RuntimeError with dot product #6

liperrino opened this issue Feb 8, 2019 · 0 comments

Comments

@liperrino
Copy link

when running the train.py file i got:
/media/vivien/A/NEW-SMT/Neural-Machine-Translation/data/deu.txt
Traceback (most recent call last):
File "train.py", line 124, in
loss = train(input_variable, target_variable, encoder, decoder, encoder_optimizer, decoder_optimizer, criterion)
File "train.py", line 53, in train
encoder_outputs)
File "/home/vivien/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/media/vivien/A/NEW-SMT/Neural-Machine-Translation/src/attention_decoder.py", line 55, in forward
attention_weights = self.attention(rnn_output.squeeze(0), encoder_outputs)
File "/home/vivien/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/media/vivien/A/NEW-SMT/Neural-Machine-Translation/src/attention.py", line 41, in forward
energies[i] = self._score(hidden, encoder_outputs[i])
File "/media/vivien/A/NEW-SMT/Neural-Machine-Translation/src/attention.py", line 51, in _score
energy = hidden.dot(energy)
RuntimeError: dot: Expected 1-D argument self, but got 2-D

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