From 66f4ae0261e42ca94f6ba19f73f76bd452873d98 Mon Sep 17 00:00:00 2001 From: WenmuZhou <572459439@qq.com> Date: Mon, 22 Aug 2022 02:25:24 +0000 Subject: [PATCH] fix is_nlp_model not define error in save_model --- ppocr/utils/save_load.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ppocr/utils/save_load.py b/ppocr/utils/save_load.py index 0c652c8f..f8612552 100644 --- a/ppocr/utils/save_load.py +++ b/ppocr/utils/save_load.py @@ -194,6 +194,9 @@ def save_model(model, _mkdir_if_not_exist(model_path, logger) model_prefix = os.path.join(model_path, prefix) paddle.save(optimizer.state_dict(), model_prefix + '.pdopt') + + is_nlp_model = config['Architecture']["model_type"] == 'kie' and config[ + "Architecture"]["algorithm"] not in ["SDMGR"] if is_nlp_model is not True: paddle.save(model.state_dict(), model_prefix + '.pdparams') metric_prefix = model_prefix -- GitLab