From 592bd60fe2cb76c72d00f7724c7e6c306eea840a Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Fri, 6 Nov 2020 18:22:31 +0800 Subject: [PATCH] switch learning_rate and lr --- ppocr/optimizer/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ppocr/optimizer/__init__.py b/ppocr/optimizer/__init__.py index 72366e50..6413ae95 100644 --- a/ppocr/optimizer/__init__.py +++ b/ppocr/optimizer/__init__.py @@ -29,7 +29,7 @@ def build_lr_scheduler(lr_config, epochs, step_each_epoch): lr_name = lr_config.pop('name') lr = getattr(learning_rate, lr_name)(**lr_config)() else: - lr = lr_config['lr'] + lr = lr_config['learning_rate'] return lr @@ -37,8 +37,7 @@ def build_optimizer(config, epochs, step_each_epoch, parameters): from . import regularizer, optimizer config = copy.deepcopy(config) # step1 build lr - lr = build_lr_scheduler( - config.pop('learning_rate'), epochs, step_each_epoch) + lr = build_lr_scheduler(config.pop('lr'), epochs, step_each_epoch) # step2 build regularization if 'regularizer' in config and config['regularizer'] is not None: -- GitLab