Skip to content

Commit

Permalink
update save model (#6697)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenmuZhou authored Jun 24, 2022
1 parent ab30f23 commit fe8d103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ppocr/utils/save_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ def save_model(model,
model.backbone.model.save_pretrained(model_prefix)
metric_prefix = os.path.join(model_prefix, 'metric')
# save metric and config
with open(metric_prefix + '.states', 'wb') as f:
pickle.dump(kwargs, f, protocol=2)
if is_best:
with open(metric_prefix + '.states', 'wb') as f:
pickle.dump(kwargs, f, protocol=2)
logger.info('save best model is to {}'.format(model_prefix))
else:
logger.info("save model in {}".format(model_prefix))

0 comments on commit fe8d103

Please sign in to comment.