"src/include/functional3.hpp" did not exist on "0a386c46a9f05b95b8bc5d710ffce664f5fd0d41"
Unverified Commit f7111d7b authored by littletomatodonkey's avatar littletomatodonkey Committed by GitHub
Browse files

Merge pull request #467 from BeyondYourself/develop

add a necessary check for checkpoints
parents f7b5edcc a4abf132
......@@ -109,9 +109,14 @@ def init_model(config, program, exe):
"""
checkpoints = config['Global'].get('checkpoints')
if checkpoints:
path = checkpoints
fluid.load(program, path, exe)
logger.info("Finish initing model from {}".format(path))
if os.path.exists(checkpoints + '.pdparams'):
path = checkpoints
fluid.load(program, path, exe)
logger.info("Finish initing model from {}".format(path))
else:
raise ValueError(
"Model checkpoints {} does not exists,"
"check if you lost the file prefix.".format(checkpoints + '.pdparams'))
pretrain_weights = config['Global'].get('pretrain_weights')
if pretrain_weights:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment