未验证 提交 c4ca35a2 编写于 作者: S shaohua.zhang 提交者: GitHub

Update utility.py

上级 d7d35578
...@@ -21,6 +21,7 @@ import os ...@@ -21,6 +21,7 @@ import os
import shutil import shutil
import tempfile import tempfile
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from .utility import initial_logger from .utility import initial_logger
...@@ -112,12 +113,14 @@ def init_model(config, program, exe): ...@@ -112,12 +113,14 @@ def init_model(config, program, exe):
path = checkpoints path = checkpoints
fluid.load(program, path, exe) fluid.load(program, path, exe)
logger.info("Finish initing model from {}".format(path)) logger.info("Finish initing model from {}".format(path))
return
pretrain_weights = config['Global'].get('pretrain_weights') pretrain_weights = config['Global'].get('pretrain_weights')
if pretrain_weights: if pretrain_weights:
path = pretrain_weights path = pretrain_weights
load_params(exe, program, path) load_params(exe, program, path)
logger.info("Finish initing model from {}".format(path)) logger.info("Finish initing model from {}".format(path))
return
def save_model(program, model_path): def save_model(program, model_path):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册