I have trained several Transformer models on Europarl data.
When training on the same data an LSTM model it fails on the validation step with the following error:
RuntimeError: Length of all samples has to be greater than 0, but found an element in 'lengths' that is <= 0
According to this post: https://github.com/OpenNMT/OpenNMT-py/issues/1342 it is due to the fact that some sentences in the validation set are empty. However, it is exactly the same as with the Transformer.
Any idea how to mitigate this issue? Could the
-filter_valid option of the
preprocess.py be a suitable way to solve the problem?