jungomi / math-formula-recognition

Math formula recognition (Images to LaTeX strings)
MIT License
290 stars 66 forks source link

Exception: Truth contains unknown token. When I try to train my own data. #22

Open ArtificialZeng opened 2 years ago

ArtificialZeng commented 2 years ago

(torch11) ailab@ailab:~/math-formula-recognition-master$ python train.py --prefix "some-name-" -n 200 Running 200 epochs on cpu Traceback (most recent call last): File "/home/ailab/math-formula-recognition-master/dataset.py", line 60, in encode_truth index, tok_len = max(matching_starts, key=lambda match: match[1]) ValueError: max() arg is an empty sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 521, in main() File "train.py", line 444, in main gt_train, tokensfile, root=root, crop=options.crop, transform=transformers File "/home/ailab/math-formula-recognition-master/dataset.py", line 137, in init for p, truth in reader File "/home/ailab/math-formula-recognition-master/dataset.py", line 137, in for p, truth in reader File "/home/ailab/math-formula-recognition-master/dataset.py", line 64, in encode_truth raise Exception("Truth contains unknown token") Exception: Truth contains unknown token

ArtificialZeng commented 2 years ago

How to label my own data, and train