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: input must have 3 dimensions, got 2 #2

Open
xiang526 opened this issue Sep 25, 2020 · 0 comments
Open

RuntimeError: input must have 3 dimensions, got 2 #2

xiang526 opened this issue Sep 25, 2020 · 0 comments

Comments

@xiang526
Copy link

when I run the code of dense modul, a error arise: RuntimeError: input must have 3 dimensions, got 2

File "F:\jupyter project\菜鸟的自我拯救\20Urban Traffic Prediction36\Dense module\training.py", line 203, in
y_time = evaluate_temp_att(temporal_encoder, temporal_decoder, x_time, opt.n_out_sp, device)

File "F:\jupyter project\菜鸟的自我拯救\20Urban Traffic Prediction36\Dense module\utils.py", line 201, in evaluate_temp_att
encoder_output, h = encoder(batch,h)

File "E:\anconda\lib\site-packages\torch\nn\modules\module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)

File "../Temporal module\bahdanau_att.py", line 48, in forward
output, hidden = self.lstm(inputs, hidden)

File "E:\anconda\lib\site-packages\torch\nn\modules\module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)

File "E:\anconda\lib\site-packages\torch\nn\modules\rnn.py", line 574, in forward
self.check_forward_args(input, hx, batch_sizes)

File "E:\anconda\lib\site-packages\torch\nn\modules\rnn.py", line 525, in check_forward_args
self.check_input(input, batch_sizes)

File "E:\anconda\lib\site-packages\torch\nn\modules\rnn.py", line 175, in check_input
expected_input_dim, input.dim()))

RuntimeError: input must have 3 dimensions, got 2

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