diff --git a/docs/zh_cn/quick_start/quant_aware_tutorial.md b/docs/zh_cn/quick_start/quant_aware_tutorial.md index 5a0783018b780ae6962478ca0bc25808e83dbc86..bfafa2f4995bea098da7e365100c1aa87f4be451 100644 --- a/docs/zh_cn/quick_start/quant_aware_tutorial.md +++ b/docs/zh_cn/quick_start/quant_aware_tutorial.md @@ -126,14 +126,14 @@ test(val_quant_program) ```python float_prog, int8_prog = slim.quant.convert(val_quant_program, exe.place, save_int8=True) -target_vars = [float_prog.global_block().var(name) for name in outputs] +target_vars = [float_prog.global_block().var(outputs[-1])] fluid.io.save_inference_model(dirname='./inference_model/float', - feeded_var_names=[var.name for var in inputs], + feeded_var_names=[inputs[0].name], target_vars=target_vars, executor=exe, main_program=float_prog) fluid.io.save_inference_model(dirname='./inference_model/int8', - feeded_var_names=[var.name for var in inputs], + feeded_var_names=[inputs[0].name], target_vars=target_vars, executor=exe, main_program=int8_prog) diff --git a/paddleslim/models/util.py b/paddleslim/models/util.py index 3255acc57626d8c3e5512666b46df780fa0d8ba5..962db792e1c5214e96e6ffd73cdec0140b39b430 100644 --- a/paddleslim/models/util.py +++ b/paddleslim/models/util.py @@ -29,4 +29,4 @@ def image_classification(model, image_shape, class_num, use_gpu=False): exe = fluid.Executor(place) exe.run(fluid.default_startup_program()) return exe, train_program, val_program, (image, label), ( - acc_top1.name, acc_top5.name, avg_cost.name) + acc_top1.name, acc_top5.name, avg_cost.name, out.name)