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: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 32 and 1 in dimension 0 at /pytorch/aten/src/TH/generic/THTensor.cpp:689 #12

Open
devdev999 opened this issue Oct 24, 2019 · 0 comments

Comments

@devdev999
Copy link

Have attached traceback, am not sure what is calling this error.

Traceback (most recent call last):
File "train.py", line 283, in
train(opt)
File "train.py", line 173, in train
out = model(fc_feats, att_feats, labels, sen_embed)
File "/im2p/im2penv/lib/python2.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/im2p/GoodNews-master/models/OldModel.py", line 100, in forward
else: output, state = self.core(xt, fc_feats, att_feats, state, sen_embed)
File "/im2p/im2penv/lib/python2.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/im2p/GoodNews-master/models/OldModel.py", line 398, in forward
output, state = self.rnn(torch.cat([xt, att_res, att_res_sen.float()], 1).unsqueeze(0), state)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 32 and 1 in dimension 0 at /pytorch/aten/src/TH/generic/THTensor.cpp:689
Closing remaining open files:./data/data_news_image.h5...done./data/data_news_label.h5...done

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