We are having problems with the attention matrix and the alignment matrix.
When batch translating (translator.translate_batch()) the second dimension of the matrix in the answer corresponds to the shortest source, i.e. If we translate “Hello” and “I like red cars” in a batch and get “Hola” and “Me gustan los coches rojos”, we are getting a 2x1 matrix for the first sentence and a 6x1 matrix for the second, instead of 6x4.
On the other hand, when we activate the alignment debug option we get the following error:
onmt/translate/translator.py", line 408, in translate
align = trans.word_aligns.tolist()
TypeError: ‘NoneType’ object is not subscriptable
or using report align:
onmt/decoders/transformer.py", line 101, in forward
if self.alignment_heads > 0:
TypeError: ‘>’ not supported between instances of ‘NoneType’ and ‘int’
Your help is greatly appreciated, thanks.