From 9710078efa419c2649cfb5218fe3acd0cbfb2b50 Mon Sep 17 00:00:00 2001 From: Bai Yifan Date: Tue, 24 Mar 2020 17:49:13 +0800 Subject: [PATCH] fix distill cifar demo (#188) --- demo/distillation/distill.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/distillation/distill.py b/demo/distillation/distill.py index 9ea119d1..3bafa159 100644 --- a/demo/distillation/distill.py +++ b/demo/distillation/distill.py @@ -164,8 +164,12 @@ def compress(args): ), "teacher_pretrained_model should be set when teacher_model is not None." def if_exist(var): - return os.path.exists( + exist = os.path.exists( 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( exe, -- GitLab