stevezheng23 / seq2seq_tf

Sequence-to-Sequence in Tensorflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot feed value of shape () for Tensor 'seq2seq/encoder/embedding/embedding_placeholder:0', which has shape '(7710, 300)'

MoyangSensei opened this issue · comments

Thank you for the code. I hope to use your code to do the work of reproduction, but I encountered such an error:

b'2020-12-13 03:06:29: # create projection layer for decoder'
2020-12-13 11:06:29.246611: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
b'2020-12-13 03:06:29: ##### start training #####'
Traceback (most recent call last):
File "seq2seq_run.py", line 324, in
main(args)
File "seq2seq_run.py", line 314, in main
train(logger, hyperparams)
File "seq2seq_run.py", line 160, in train
train_model.src_embedding, train_model.trg_embedding)
File "/Users/jfy/study_g/work/dl/ch3_2030701011/seq2seq_tf/seq2seq/model/seq2seq.py", line 472, in train
self.decoder_embedding_placeholder: trg_embedding})
File "/Users/jfy/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/Users/jfy/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1128, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape () for Tensor 'seq2seq/encoder/embedding/embedding_placeholder:0', which has shape '(7710, 300)'

TF version is 1.12, numpy version has been adjusted to 1.15 by me, but it still doesn't work. How can I modify the code?

The command I run is
python seq2seq_run.py --mode train --config config/config_seq2seq_template.attention.json

The command I run is
python seq2seq_run.py --mode train --config config/config_seq2seq_template.attention.json

Hi @MoyangSensei , can you share the modified config file for debugging? Looks like the vocab size is different from the default value