未验证 提交 9710078e 编写于 作者: B Bai Yifan 提交者: GitHub

fix distill cifar demo (#188)

上级 188ec0d9
...@@ -164,8 +164,12 @@ def compress(args): ...@@ -164,8 +164,12 @@ def compress(args):
), "teacher_pretrained_model should be set when teacher_model is not None." ), "teacher_pretrained_model should be set when teacher_model is not None."
def if_exist(var): def if_exist(var):
return os.path.exists( exist = os.path.exists(
os.path.join(args.teacher_pretrained_model, var.name)) os.path.join(args.teacher_pretrained_model, var.name))
if args.data == "cifar10" and (var.name == 'fc_0.w_0' or
var.name == 'fc_0.b_0'):
exist = False
return exist
fluid.io.load_vars( fluid.io.load_vars(
exe, exe,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册