practical-pytorch icon indicating copy to clipboard operation
practical-pytorch copied to clipboard

About seq2seq-translation-batched.py RuntimeError

Open xiangningOvo opened this issue 4 years ago • 1 comments

there was error occured:

in score(self, hidden, encoder_output)
     35         elif self.method == 'general':
     36             energy = self.attn(encoder_output)
---> 37             energy = hidden.dot(energy)
     38             return energy
     39 

RuntimeError: 1D tensors expected, but got 2D and 2D tensors

I modify nothing. Can anyone help me!?Thank you

xiangningOvo avatar Nov 23 '20 09:11 xiangningOvo

Hi, Do one thing you can reshape you data then try.

On Mon, 23 Nov, 2020, 15:15 相宁, [email protected] wrote:

there was error occured:

in score(self, hidden, encoder_output) 35 elif self.method == 'general': 36 energy = self.attn(encoder_output) ---> 37 energy = hidden.dot(energy) 38 return energy 39

RuntimeError: 1D tensors expected, but got 2D and 2D tensors

I modify nothing. Can anyone help me!?Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/spro/practical-pytorch/issues/148, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7HSYT7GPB77QQ74KXOLXLSRIVLRANCNFSM4T7HZG4A .

SANTOSHMAHER avatar Nov 23 '20 15:11 SANTOSHMAHER