prdwb/attentive_history_selection

NameError: name 'train_summary' is not defined

Closed this issue · 4 comments

hi,can you tell me how this problem solves?I don't know why.
`InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 26019840 values, but the requested shape has 34693120
[[Node: history_attention_model/Tensordot/Reshape = _MklReshape[T=DT_FLOAT, Tshape=DT_INT32, _kernel="MklOp", _device="/job:localhost/replica:0/task:0/device:CPU:0"](history_attention_model/Tensordot/transpose, history_attention_model/Tensordot/Reshape/shape, DMT/_244, DMT/_245)]]

File "cqa_run_his_atten.py", line 395, in
yesno_labels: fd_output['yesno'], followup_labels: fd_output['followup'], training: True})
File "/home/share/anaconda3/envs/tensorflow1.8/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/home/share/anaconda3/envs/tensorflow1.8/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "/home/share/anaconda3/envs/tensorflow1.8/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run
run_metadata)
File "/home/share/anaconda3/envs/tensorflow1.8/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
Traceback (most recent call last):
File "cqa_run_his_atten.py", line 401, in
train_summary_writer.add_summary(train_summary, step)
NameError: name 'train_summary' is not defined
`

prdwb commented

Hi, I wasn't able to pinpoint the issue based on this information. It seems the error happens in the training loop. Can I take a look at your command?

Hi, I wasn't able to pinpoint the issue based on this information. It seems the error happens in the training loop. Can I take a look at your command?
does the glove: /mnt/scratch/chenqu/glove/glove.840B.300d.pkl matters?
1
2
3

prdwb commented

Thank you for attaching the snapshots. It seems --bert_hidden is set to 1024, which is incompatible with the bert base model you are using, causing the discrepancies in the tensor shape. You can either switch to bert large or set --bert_hidden to 768. Note that our example commands are for bert large.

--load_small_portion should be set to False when running full-scale experiments. It's fine to set it to True when debugging the model.

Thank you for attaching the snapshots. It seems --bert_hidden is set to 1024, which is incompatible with the bert base model you are using, causing the discrepancies in the tensor shape. You can either switch to bert large or set --bert_hidden to 768. Note that our example commands are for bert large.

--load_small_portion should be set to False when running full-scale experiments. It's fine to set it to True when debugging the model.

Thanks!!!!