I am using OpenNMT Transformer model for summarization task, and I have modified multi_headed_attn.py module for my research. I just add one more linear layer in multi_headed_attn.py.
It can normally train and predict. However, it will predict some empty lines. Most of outputs are fine, but few of outputs are empty. The inputs are all normal sentence, not empty.
I found that there is a similar problem but without answer. (Transformer model is generating empty lines, when using Sentencepiece Model)
It seems that he didn’t modify the openNMT module but still face this problem.
Does someone have any idea why this happen?