clovaai / deep-text-recognition-benchmark

Text recognition (optical character recognition) with deep learning methods, ICCV 2019
Apache License 2.0
3.74k stars 1.1k forks source link

KeyError: 'b' #233

Open freedom9393 opened 4 years ago

freedom9393 commented 4 years ago

When I try to train my model with Korean characters, following errors comes up:

Traceback (most recent call last):
  File "train.py", line 313, in <module>
    train(opt)
  File "train.py", line 149, in train
    text, length = converter.encode(labels, batch_max_length=opt.batch_max_length)
  File "D:\Projects\deep-text-recognition-benchmark-master\deep-text-recognition-benchmark-master\utils.py", line 136, in encode
    text = [self.dict[char] for char in text]
  File "D:\Projects\deep-text-recognition-benchmark-master\deep-text-recognition-benchmark-master\utils.py", line 136, in <listcomp>
    text = [self.dict[char] for char in text]
KeyError: 'b'

Why is this happening??

SrijithBalachander commented 4 years ago

Your dataset probably has a character 'b' while your character set doesn't have 'b' defined.