Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

RuntimeError: inconsistent tensor size #36

Open
lixiangpengcs opened this issue Mar 27, 2018 · 2 comments
Open

RuntimeError: inconsistent tensor size #36

lixiangpengcs opened this issue Mar 27, 2018 · 2 comments

Comments

@lixiangpengcs
Copy link

lixiangpengcs commented Mar 27, 2018

According to others' advice i modified these part:

  1. File "/home/lxp/CodeBase/VisualReasoning/clevr-iep/iep/models/seq2seq.py", line 154, in sample
    y.append(next_y[0, 0, 0]) ===> y.append(next_y[0, 0])
  2. add cur_output = cur_output.unsqueeze(0) to seq2seq.py, line 175, in sample

But there is a new error in training step 3 (PG+EE):

Traceback (most recent call last):
File "scripts/train_model.py", line 490, in
main(args)
File "scripts/train_model.py", line 151, in main
train_loop(args, train_loader, val_loader)
File "scripts/train_model.py", line 239, in train_loop
programs_pred = program_generator.reinforce_sample(questions_var)
File "/home/lxp/CodeBase/VisualReasoning/clevr-iep/iep/models/seq2seq.py", line 182, in reinforce_sample
y[:, t][not_done] = cur_output_data[not_done]
RuntimeError: inconsistent tensor size, expected src [64 x 1] and mask [64 x 64] to have the same number of elements, but got 64 and 4096 elements respectively at /opt/conda/conda-bld/pytorch_1513368888240/work/torch/lib/TH/generic/THTensorMath.c:197

And I don't know why. Is there any solution to solve it?

@jivatneet
Copy link

@lixiangpengcs were you able to resolve this?

@insung3511
Copy link

has anyone solved that problem? because I got a same problem to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants