From 3a2d0f61eedefad20dac0115a63c52a7c4398bf6 Mon Sep 17 00:00:00 2001 From: bingooo Date: Thu, 1 Jul 2021 15:26:55 +0800 Subject: [PATCH] fix bug --- ppocr/utils/save_load.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/utils/save_load.py b/ppocr/utils/save_load.py index 76420abb..b762c0bb 100644 --- a/ppocr/utils/save_load.py +++ b/ppocr/utils/save_load.py @@ -98,7 +98,7 @@ def load_dygraph_params(config, model, logger, optimizer): pm = config['Global']['pretrained_model'] if pm is None: return {} - if not os.path.exists(pm) or not os.path.exists(pm + ".pdparams"): + if not os.path.exists(pm) and not os.path.exists(pm + ".pdparams"): logger.info(f"The pretrained_model {pm} does not exists!") return {} pm = pm if pm.endswith('.pdparams') else pm + '.pdparams'