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

Error in Neural Network construction #15

Open
rodolfobolconte opened this issue May 20, 2022 · 0 comments
Open

Error in Neural Network construction #15

rodolfobolconte opened this issue May 20, 2022 · 0 comments

Comments

@rodolfobolconte
Copy link

I trying to run the original code, but arrived in the follow error when I think occours in NN creation:

  0%|                                                                                                        | 0/209.4375 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "trainer_hrlce.py", line 784, in <module>
    main()
  File "trainer_hrlce.py", line 730, in main
    one_fold(idx, _train_index, _dev_index)
  File "trainer_hrlce.py", line 591, in one_fold
    pred, pred2, pred3 = model(a.cuda(), a_len, b.cuda(), b_len, c.cuda(), c_len, emoji_a.cuda(), emoji_b.cuda(), emoji_c.cuda(), elmo_a, elmo_b, elmo_c)
  File "/home/rodolfo/anaconda3/envs/hrlce/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/rodolfo/avard/HRLCE/SemEval2019Task3/model/hrlce.py", line 144, in forward
    attention_layer=self.a_self_attention)
  File "/home/rodolfo/avard/HRLCE/SemEval2019Task3/model/hrlce.py", line 113, in lstm_forward
    packed_output, hidden = lstm(packed_input, hidden)
  File "/home/rodolfo/anaconda3/envs/hrlce/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/rodolfo/anaconda3/envs/hrlce/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 759, in forward
    self.check_forward_args(input, hx, batch_sizes)
  File "/home/rodolfo/anaconda3/envs/hrlce/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 684, in check_forward_args
    self.check_input(input, batch_sizes)
  File "/home/rodolfo/anaconda3/envs/hrlce/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 207, in check_input
    self.input_size, input.size(-1)))
RuntimeError: input.size(-1) must be equal to input_size. Expected 1324, got 556

Any help to fix this?

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