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

Incorrect number of classes

Open maykulkarni opened this issue 5 years ago • 4 comments

Hey thanks for sharing the code, but I found a possible issue while training the network. While editing the number of characters in the alphabet.py file, I followed the guide and replaced the Chinese characters by English one and my network trained fine. But while reading the code and debugging I found that the nClass output dimension of the CRNN was 72 while the number of unique characters in the alphabet.py class was only 36. I eventually realized that that code is splitting the characters wrongly and considering \n newline as a character as well that's why the output dimension was [26x1x72] instead of [26x1x37] this can cause an issue in training. I can raise a PR fixing this if you want. Thanks.

maykulkarni avatar Jan 31 '20 04:01 maykulkarni

Of course you can. Thank you~

Holmeyoung avatar Mar 03 '20 07:03 Holmeyoung

Hello, how can I solve this problem!

livekeys avatar Mar 23 '20 05:03 livekeys

@livekeys just edit the alphabet.py to have all the characters in the same line this way \n will not be treated as a new character.

maykulkarni avatar Mar 24 '20 06:03 maykulkarni

Thank you very much!

livekeys avatar Mar 24 '20 06:03 livekeys