Sierkinhane / CRNN_Chinese_Characters_Rec

(CRNN) Chinese Characters Recognition.
1.82k stars 538 forks source link

How to train model with linear layer or conv layer? #230

Open feitiandemiaomi opened 4 years ago

feitiandemiaomi commented 4 years ago

Thanks for great repo , The model can be trained normally, but when I replace the lstm layer with a convolutional layer or linear layer ,the model can't converge, and the loss decreased from 270 to 4. I try to modify lr from 0.01 to 0.0000001, it also dosen't work, can you give some advice? 图片 @Sierkinhane

Sierkinhane commented 4 years ago

If you use ctcloss, I advice you to check the version of pytorch, 1.2.0 is ok, other versions are not tested. Otherwise, maybe you should check whether a nan existed in your tensor before computing loss.

feitiandemiaomi commented 4 years ago

Yes,I use ctcloss , My verison is pytorch1.1.0 ,Just now ,I trained it with Pytorch1.2.0 ,the output are as follows: 图片 There was a problem from the beginning,Did you do something else, or could you provide the code?

Sierkinhane commented 4 years ago

you can try this ctcloss implementation https://github.com/SeanNaren/Warp-ctc

Sierkinhane commented 4 years ago

@feitiandemiaomi