According to others' advice i modified these part:
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])
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?
According to others' advice i modified these part:
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?