提交 697719ba 编写于 作者: W WenmuZhou

fix error in load model

上级 818ab4ed
...@@ -77,7 +77,7 @@ def init_model(config, model, optimizer=None, lr_scheduler=None): ...@@ -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
os.path.exists(pretrained + '.pdparams')): not 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')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册