This commit is contained in:
bingooo 2021-07-01 15:26:55 +08:00 committed by GitHub
parent 5661c6865c
commit 3a2d0f61ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ def load_dygraph_params(config, model, logger, optimizer):
pm = config['Global']['pretrained_model'] pm = config['Global']['pretrained_model']
if pm is None: if pm is None:
return {} 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!") logger.info(f"The pretrained_model {pm} does not exists!")
return {} return {}
pm = pm if pm.endswith('.pdparams') else pm + '.pdparams' pm = pm if pm.endswith('.pdparams') else pm + '.pdparams'