Closed mcemilg closed 6 years ago
Had the same error. Make sure you are passing the tf.nn.embedding_lookup to the inputs arg of the tf.contrib.seq2seq.TrainingHelper - and - passing the embedding weight matrix itself to embedding arg of tf.contrib.seq2seq.GreedyEmbeddingHelper. From your code, you are passing the same variable decoder_emb_inp to both.
Yeah actually I solved the issue like your said. And I forget to close the issue, thanks.
I'm trying to build a basic encoder-decoder model. I build the model for training graph and it works perfect. The helper of the decoder is
tf.contrib.seq2seq.TrainingHelper
. But when I switch to helper totf.contrib.seq2seq.GreedyEmbeddingHelper
it throws a shape error.Here it is my working helper.
And here it is the what I want to do.
I am using the same decoder and dynamic_decoding. It works with
TrainingHelper
, but it didn't work withGreedyEmbeddingHelper
.And here it is the error.