I am trying to fine tune LayoutLm for SROIE receipt named entity extraction. I checked the github page of Layoutlm and used their run_seq_labelling.py and preprocess.py on this new dataset i prepared but i am receiving following error:
Iteration: 4%|█████▉ | 21/577 [00:53<23:45, 2.56s/it]
Epoch: 0%| | 0/100 [00:53<?, ?it/s]
Traceback (most recent call last):
File "run_seq_labeling.py", line 812, in <module>
main()
File "run_seq_labeling.py", line 705, in main
args, train_dataset, model, tokenizer, labels, pad_token_label_id
File "run_seq_labeling.py", line 220, in train
outputs = model(**inputs)
File "/home/ml3/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/ml3/.local/lib/python3.6/site-packages/layoutlm/modeling/layoutlm.py", line 221, in forward
head_mask=head_mask,
File "/home/ml3/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/ml3/.local/lib/python3.6/site-packages/layoutlm/modeling/layoutlm.py", line 171, in forward
input_ids, bbox, position_ids=position_ids, token_type_ids=token_type_ids
File "/home/ml3/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/ml3/.local/lib/python3.6/site-packages/layoutlm/modeling/layoutlm.py", line 82, in forward
bbox[:, :, 2] - bbox[:, :, 0]
File "/home/ml3/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/ml3/.local/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 126, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/ml3/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 1814, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self
I am using transformers 2.9 as the github page states as a requirement