WenmuZhou / PytorchOCR

基于Pytorch的OCR工具库,支持常用的文字检测和识别算法

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CRNN中文训练不收敛,只有lr=0.005才勉强能慢慢收敛,非常慢

huangxin168 opened this issue · comments

大佬,我试了您这个CRNN MobileNetV3 small,太难收敛了,已按指示修改: #246 (comment)

我的中文字符nclass 7000多,每张30个字符左右,100W张的数据集,lr=0.005、或0.003才勉强能慢慢收敛,看趋势要20个epoch以上才能完全收敛(或许不完全)。而设置其他lr值则完全不能收敛。
同样数据集用另一个网络为VGG的github CRNN项目训练,如果lr选择得好,只要1个epoch就acc0.8以上。

weight_init(m)中Conv的设置:
init.kaiming_normal_(m.weight.data)
改为:
init.kaiming_normal_(m.weight.data, mode='fan_out', nonlinearity='relu')
则能在更大范围的lr值训练收敛,例如0.01、0.001。

具体原因不太清楚,恳请大佬花点时间看看这个问题,能不能优化一下。

更新:
resnet34中文训练在lr=0.0001时跑8k step才开始收敛,如果开数据增强收敛更迟