提交 7e2b43d2 编写于 作者: C chenguowei01

update utils.py

上级 826706de
...@@ -88,6 +88,7 @@ def resume(model, optimizer, resume_model): ...@@ -88,6 +88,7 @@ def resume(model, optimizer, resume_model):
if resume_model is not None: if resume_model is not None:
logging.info('Resume model from {}'.format(resume_model)) logging.info('Resume model from {}'.format(resume_model))
if os.path.exists(resume_model): if os.path.exists(resume_model):
resume_model = os.path.normpath(resume_model)
ckpt_path = os.path.join(resume_model, 'model') ckpt_path = os.path.join(resume_model, 'model')
para_state_dict, opti_state_dict = fluid.load_dygraph(ckpt_path) para_state_dict, opti_state_dict = fluid.load_dygraph(ckpt_path)
model.set_dict(para_state_dict) model.set_dict(para_state_dict)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册