NormXU/ERNIE-Layout-Pytorch

different label pad token id between layoutxlm and ernie layout

Closed this issue · 1 comments

Hi, I find that the label_pad_token id is different between layoutxlm and ernie layout in token classification. In layoutxlm, the label_pad_token id is -100 and will be ignored by pytorch loss functions url. However the label_pad_token id is 0 in ernie layout and will be calculated loss. url2

Thanks for pointing out the bug. I've fixed it.