unilm icon indicating copy to clipboard operation
unilm copied to clipboard

Assertion Error in convert_examples_to_features function

Open sibtain-r opened this issue 6 years ago • 3 comments

I am getting error For all sequences i have len(label_ids)==512 but for 1 example i am getting a length of 513. Assertion Error, assert(len(label_ids)==max_seq_length) What is the reason behind this error?

sibtain-r avatar Jun 24 '20 11:06 sibtain-r

Did you solve the problem?

hasansalimkanmaz avatar Aug 25 '20 16:08 hasansalimkanmaz

I had an error in layoutlm/data/funsd.py on the line: assert splits[0] == bsplits[0]

The problem was after the following split because some samples had actually a '\T' in it: splits = line.split("\t") bsplits = bline.split("\t")

after replacing '\T' in the text the problem was gone. Maybe it's somethin similar here.

r000bin avatar Aug 27 '20 12:08 r000bin

Hi @r000bin, I encountered the same error. In the solution you provided, did you mean that you replaced '\T' in the train.txt file?

ssherlins avatar May 29 '21 08:05 ssherlins