提交 bc4fad32 编写于 作者: W wanghaoshuang

Add check for pretrained model.

上级 2cf4b202
......@@ -88,6 +88,7 @@ def compress(args):
exe.run(fluid.default_startup_program())
if args.pretrained_model:
assert os.path.exists(args.pretrained_model), "pretrained_model is not exist!!!"
def if_exist(var):
return os.path.exists(os.path.join(args.pretrained_model, var.name))
fluid.io.load_vars(exe, args.pretrained_model, predicate=if_exist)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册