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

bi-directional gru #35

Open
Binyun-Z opened this issue May 5, 2023 · 0 comments
Open

bi-directional gru #35

Binyun-Z opened this issue May 5, 2023 · 0 comments

Comments

@Binyun-Z
Copy link

Binyun-Z commented May 5, 2023

I found a bug in the code, when I use bi-directional gru the dimensions don't correspond.

Traceback (most recent call last):
File "inference.py", line 80, in
main(args)
File "inference.py", line 44, in main
samples, z = model.inference(n=args.num_samples)
File "/home/bli/Binyun/Generation/Sentence-VAE/model.py", line 153, in inference
output, hidden = self.decoder_rnn(input_embedding, hidden)
File "/home/bli/.conda/envs/Xihe/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/bli/.conda/envs/Xihe/lib/python3.8/site-packages/torch/nn/modules/rnn.py", line 819, in forward
self.check_forward_args(input, hx, batch_sizes)
File "/home/bli/.conda/envs/Xihe/lib/python3.8/site-packages/torch/nn/modules/rnn.py", line 229, in check_forward_args
self.check_hidden_size(hidden, expected_hidden_size)
File "/home/bli/.conda/envs/Xihe/lib/python3.8/site-packages/torch/nn/modules/rnn.py", line 223, in check_hidden_size
raise RuntimeError(msg.format(expected_hidden_size, list(hx.size())))
RuntimeError: Expected hidden size (2, 10, 256), got [1, 2, 10, 256]

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