meijieru / crnn.pytorch

Convolutional recurrent network in pytorch
MIT License
2.4k stars 657 forks source link

'alphate' change to 'self.alphabet' #198

Open fsluckymao opened 5 years ago

fsluckymao commented 5 years ago

Hi:@meijieru https://github.com/meijieru/crnn.pytorch/blob/d3a47f91691b31b8d5336e2ed5932e6cf65142f0/utils.py#L28 I deem here 'alphate' need change to 'self.alphabet'

Otherwise it may cause following problem. Traceback (most recent call last): File "zhaoyuanying.py", line 84, in t, l = converter.encode(cpu_texts)#,scanned=False) File "/home/mcht/tmp/crnn_pytorch/utils.py", line 84, in encode for char in text File "/home/mcht/tmp/crnn_pytorch/utils.py", line 84, in for char in text KeyError: '-'

meijieru commented 5 years ago

It's intended to be that. Since your label should not contains - character.

fsluckymao commented 5 years ago

I get it Thanks!

cqray1990 commented 5 years ago

but my data need recoginise '-'?? whether should i change '-'?

fsluckymao commented 5 years ago

@leigaoxiang : You can try blank to separate them