fix error in load model

This commit is contained in:
WenmuZhou 2021-07-15 16:08:56 +08:00
parent 697719ba3c
commit f7a62d945e
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ def init_model(config, model, optimizer=None, lr_scheduler=None):
pretrained_model = [pretrained_model] pretrained_model = [pretrained_model]
for pretrained in pretrained_model: for pretrained in pretrained_model:
if not (os.path.isdir(pretrained) or if not (os.path.isdir(pretrained) or
not os.path.exists(pretrained + '.pdparams')): os.path.exists(pretrained + '.pdparams')):
raise ValueError("Model pretrain path {} does not " raise ValueError("Model pretrain path {} does not "
"exists.".format(pretrained)) "exists.".format(pretrained))
param_state_dict = paddle.load(pretrained + '.pdparams') param_state_dict = paddle.load(pretrained + '.pdparams')