Tokenization issue after upgrading to T2T 1.2.4
My t2t-decoder started to insert a blank symbol after each character after upgrading to T2T 1.2.4:
t2t-decoder
--data_dir=t2t_data/
--problems=translate_ende_wmt32k
--model=transformer
--hparams_set=transformer_base (...) INFO:tensorflow:Inference results INPUT: Airport building evacuated INFO:tensorflow:Inference results OUTPUT: F l u g h a f e n g e b <C3> <A4> u d e e v a k u i e r t
If I remove the blanks afterwards with
cat decodes | sed 's/ //g' | tr -d ' ' | sed 's// /g'
the output looks okay again. I have generated the data and trained the model with T2T 1.2.3.
So apparently this commit is the problem. Is there a particular reason for doing this or was that pushed by mistake? And why not just do
decoded_outputs = targets_vocab.decode(_save_until_eos(outputs.flatten()))
if targets is not None:
decoded_targets = targets_vocab.decode(_save_until_eos(targets.flatten()))
I have the same problem, and I think it is a bug.
Fixed with 1.2.5, thanks