crnn.pytorch icon indicating copy to clipboard operation
crnn.pytorch copied to clipboard

'alphate' change to 'self.alphabet'

Open fsluckymao opened this issue 5 years ago • 4 comments

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: '-'

fsluckymao avatar Apr 12 '19 09:04 fsluckymao

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

meijieru avatar Apr 13 '19 20:04 meijieru

I get it Thanks!

fsluckymao avatar Apr 14 '19 10:04 fsluckymao

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

cqray1990 avatar May 25 '19 10:05 cqray1990

@leigaoxiang : You can try blank to separate them

fsluckymao avatar May 27 '19 00:05 fsluckymao