tensorflow / nmt

TensorFlow Neural Machine Translation Tutorial
Apache License 2.0
6.38k stars 1.96k forks source link

Beam Search Decoder outputs -1 as prediction (how is this possible?) #246

Closed ghost closed 3 years ago

Aashit-Sharma commented 6 years ago

did you try using the FinalBeamSearchDecoderOutput instead of dynamic decode ? https://www.tensorflow.org/api_docs/python/tf/contrib/seq2seq/FinalBeamSearchDecoderOutput

classicCoder16 commented 6 years ago

Is there any update on this? @nave01314 Did you figure out how to resolve the error? I'm running into the same issue...

WenjieWWJ commented 6 years ago

Is there any update on this? @nave01314 Did you figure out how to resolve the error? I'm running into the same issue...

tomhosking commented 6 years ago

It looks like dynamic_decode() pads the output with -1 outside of the valid length. The lengths are returned by dynamic_decode() as the third variable, so you can use that to mask the output or only use the valid parts of each decoded sequence.