提交 7c15d1b7 编写于 作者: 文幕地方's avatar 文幕地方

change is to does

上级 389e315a
...@@ -57,7 +57,7 @@ def load_model(config, model, optimizer=None): ...@@ -57,7 +57,7 @@ def load_model(config, model, optimizer=None):
if checkpoints.endswith('.pdparams'): if checkpoints.endswith('.pdparams'):
checkpoints = checkpoints.replace('.pdparams', '') checkpoints = checkpoints.replace('.pdparams', '')
assert os.path.exists(checkpoints + ".pdparams"), \ assert os.path.exists(checkpoints + ".pdparams"), \
"The {}.pdparams is not exists!".format(checkpoints) "The {}.pdparams does not exists!".format(checkpoints)
# load params from trained model # load params from trained model
params = paddle.load(checkpoints + '.pdparams') params = paddle.load(checkpoints + '.pdparams')
...@@ -106,7 +106,7 @@ def load_pretrained_params(model, path): ...@@ -106,7 +106,7 @@ def load_pretrained_params(model, path):
if path.endswith('.pdparams'): if path.endswith('.pdparams'):
path = path.replace('.pdparams', '') path = path.replace('.pdparams', '')
assert os.path.exists(path + ".pdparams"), \ assert os.path.exists(path + ".pdparams"), \
"The {}.pdparams is not exists!".format(path) "The {}.pdparams does not exists!".format(path)
params = paddle.load(path + '.pdparams') params = paddle.load(path + '.pdparams')
state_dict = model.state_dict() state_dict = model.state_dict()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册