Update utility.py

This commit is contained in:
shaohua.zhang 2020-07-27 17:11:33 +08:00 committed by GitHub
parent d7d355783b
commit c4ca35a251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import os
import shutil
import tempfile
import paddle
import paddle.fluid as fluid
from .utility import initial_logger
@ -112,12 +113,14 @@ def init_model(config, program, exe):
path = checkpoints
fluid.load(program, path, exe)
logger.info("Finish initing model from {}".format(path))
return
pretrain_weights = config['Global'].get('pretrain_weights')
if pretrain_weights:
path = pretrain_weights
load_params(exe, program, path)
logger.info("Finish initing model from {}".format(path))
return
def save_model(program, model_path):