Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lr decay #58

Closed
WenmuZhou opened this issue May 18, 2020 · 2 comments
Closed

lr decay #58

WenmuZhou opened this issue May 18, 2020 · 2 comments

Comments

@WenmuZhou
Copy link
Collaborator

训练crnn,应该在哪里设置lr decay呢

@LDOUBLEV
Copy link
Collaborator

具体是在ppocr.optimizer.AdamDecay()函数中设置lr_decay。
不同的lr_decay方式可以参考官网.


PaddleOCR使用importlib 通过yml文件中的参数选择调用哪个模块,设置lr decay需要在优化器里,优化器的定义在program.py中的176行

opt_params = config['Optimizer']
optimizer = create_module(opt_params['function'])(opt_params) 

opt_params 是读取到的yml文件中的参数,假设使用config/rec/rec_chinese_lite_train.yml配置文件,有关优化器的定义是:

Optimizer:
  function: ppocr.optimizer,AdamDecay
  base_lr: 0.0005
  beta1: 0.9
  beta2: 0.999

说明优化器的声明函数的是ppocr.optimizer.AdamDecay,所以可以在AdamDecay加上lr decay。
要修改其他超参数也是同理。

@WenmuZhou
Copy link
Collaborator Author

好的,谢谢

BillDior pushed a commit to BillDior/PaddleOCR that referenced this issue Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants