Skip to content

Error in Neural Network construction #15

@rodolfobolconte

Description

@rodolfobolconte

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?

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