提交 8bf673ff 编写于 作者: D dengkaipeng

use fluid.io.load_vars

上级 819676e3
......@@ -152,7 +152,9 @@ def train(args):
# if resume weights is given, load resume weights directly
assert os.path.exists(args.resume), \
"Given resume weight dir {} not exist.".format(args.resume)
fluid.io.load_params(exe, args.resume, main_program=train_prog)
def if_exist(var):
return os.path.exists(os.path.join(args.resume, var.name))
fluid.io.load_vars(exe, args.resume, predicate=if_exist, main_program=train_prog)
else:
# if not in resume mode, load pretrain weights
if args.pretrain:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册