Skip to content

Commit

Permalink
Merge pull request #2878 from YukSing12/patch-1
Browse files Browse the repository at this point in the history
Update save_load.py
  • Loading branch information
LDOUBLEV committed May 24, 2021
2 parents b781518 + d1a7d35 commit 7fd8d6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ppocr/utils/save_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def init_model(config, model, logger, optimizer=None, lr_scheduler=None):
"""
load model from checkpoint or pretrained_model
"""
gloabl_config = config['Global']
checkpoints = gloabl_config.get('checkpoints')
pretrained_model = gloabl_config.get('pretrained_model')
global_config = config['Global']
checkpoints = global_config.get('checkpoints')
pretrained_model = global_config.get('pretrained_model')
best_model_dict = {}
if checkpoints:
assert os.path.exists(checkpoints + ".pdparams"), \
Expand All @@ -105,7 +105,7 @@ def init_model(config, model, logger, optimizer=None, lr_scheduler=None):

logger.info("resume from {}".format(checkpoints))
elif pretrained_model:
load_static_weights = gloabl_config.get('load_static_weights', False)
load_static_weights = global_config.get('load_static_weights', False)
if not isinstance(pretrained_model, list):
pretrained_model = [pretrained_model]
if not isinstance(load_static_weights, list):
Expand Down

0 comments on commit 7fd8d6a

Please sign in to comment.