From c3c453384ae43229c1371201a59b925e8ef71ebe Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Mon, 26 Oct 2020 20:15:53 +0800 Subject: [PATCH] fix save_infer_model in quant export_model (#1604) --- slim/quantization/export_model.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/slim/quantization/export_model.py b/slim/quantization/export_model.py index 512d0f6f2..91fad04e9 100644 --- a/slim/quantization/export_model.py +++ b/slim/quantization/export_model.py @@ -30,7 +30,6 @@ from ppdet.utils.cli import ArgsParser import ppdet.utils.checkpoint as checkpoint from ppdet.utils.export_utils import save_infer_model, dump_infer_config from ppdet.utils.check import check_config, check_version -from tools.export_model import prune_feed_vars import logging FORMAT = '%(asctime)s-%(levelname)s: %(message)s' @@ -81,13 +80,11 @@ def main(): infer_prog, int8_program = convert( infer_prog, place, config, save_int8=True) - save_infer_model( - os.path.join(FLAGS.output_dir, 'float'), exe, feed_vars, test_fetches, - infer_prog) + FLAGS.output_dir = os.path.join(FLAGS.output_dir, 'float') + save_infer_model(FLAGS, exe, feed_vars, test_fetches, infer_prog) - save_infer_model( - os.path.join(FLAGS.output_dir, 'int'), exe, feed_vars, test_fetches, - int8_program) + FLAGS.output_dir = os.path.join(FLAGS.output_dir, 'int') + save_infer_model(FLAGS, exe, feed_vars, test_fetches, int8_program) if __name__ == '__main__': -- GitLab