From b9606d012b7bfdad75bba0c1447290b1d3959f9a Mon Sep 17 00:00:00 2001 From: Liufang Sang Date: Thu, 21 May 2020 03:08:08 -0500 Subject: [PATCH] cherry-pick fix load inference in quant_post demo (#301) (#303) --- demo/quant/quant_post/README.md | 2 +- ..._classification_post_training_quantization_quick_start.ipynb | 2 ++ docs/en/quick_start/quant_post_tutorial_en.md | 2 ++ docs/zh_cn/quick_start/quant_post_tutorial.md | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/demo/quant/quant_post/README.md b/demo/quant/quant_post/README.md index cb5428ad..ac8146ce 100755 --- a/demo/quant/quant_post/README.md +++ b/demo/quant/quant_post/README.md @@ -62,7 +62,7 @@ top1_acc/top5_acc= [0.70913923 0.89548034] 使用以下命令测试离线量化后的模型的精度: ``` -python eval.py --model_path ./quant_model_train/MobileNet +python eval.py --model_path ./quant_model_train/MobileNet --model_name __model__ --params_name __params__ ``` 精度输出为 diff --git a/demo/quant/quant_post/image_classification_post_training_quantization_quick_start.ipynb b/demo/quant/quant_post/image_classification_post_training_quantization_quick_start.ipynb index 23b813e6..47cb0fc0 100755 --- a/demo/quant/quant_post/image_classification_post_training_quantization_quick_start.ipynb +++ b/demo/quant/quant_post/image_classification_post_training_quantization_quick_start.ipynb @@ -282,6 +282,8 @@ "source": [ "quant_post_prog, feed_target_names, fetch_targets = fluid.io.load_inference_model(\n", " dirname='./quant_post_model',\n", + " model_filename='__model__',\n", + " params_filename='__params__',\n", " executor=exe)\n", "test(quant_post_prog, fetch_targets)" ] diff --git a/docs/en/quick_start/quant_post_tutorial_en.md b/docs/en/quick_start/quant_post_tutorial_en.md index a46329f3..93b4ec03 100644 --- a/docs/en/quick_start/quant_post_tutorial_en.md +++ b/docs/en/quick_start/quant_post_tutorial_en.md @@ -116,6 +116,8 @@ Load the model after post training quantization in ``'./quant_post_model'`` and ```python quant_post_prog, feed_target_names, fetch_targets = fluid.io.load_inference_model( dirname='./quant_post_model', + model_filename='__model__', + params_filename='__params__', executor=exe) test(quant_post_prog, fetch_targets) ``` diff --git a/docs/zh_cn/quick_start/quant_post_tutorial.md b/docs/zh_cn/quick_start/quant_post_tutorial.md index 5904b872..08b3b344 100755 --- a/docs/zh_cn/quick_start/quant_post_tutorial.md +++ b/docs/zh_cn/quick_start/quant_post_tutorial.md @@ -123,6 +123,8 @@ slim.quant.quant_post( ```python quant_post_prog, feed_target_names, fetch_targets = fluid.io.load_inference_model( dirname='./quant_post_model', + model_filename='__model__', + params_filename='__params__', executor=exe) test(quant_post_prog, fetch_targets) ``` -- GitLab