GoodNews icon indicating copy to clipboard operation
GoodNews copied to clipboard

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

Open devdev999 opened this issue 5 years ago • 0 comments

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

devdev999 avatar Oct 24 '19 08:10 devdev999