diff --git a/ppocr/utils/save_load.py b/ppocr/utils/save_load.py index 76420abb5a0da3e0138478c34bdb53d593492bf4..b762c0bb74b19cd9b21cab3b6b1c4be2e2bbd6ba 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'