From 178cda1e07e5df366878d349f1326e1a627af1c6 Mon Sep 17 00:00:00 2001 From: ceci3 Date: Mon, 23 May 2022 19:25:32 +0800 Subject: [PATCH] fix imagenet ac demo (#1136) * fix imagenet ac demo * update --- demo/auto_compression/detection/README.md | 4 ++-- demo/auto_compression/image_classification/README.md | 2 +- demo/auto_compression/image_classification/run.py | 2 +- demo/auto_compression/image_classification/run.sh | 2 +- demo/auto_compression/nlp/README.md | 2 +- paddleslim/auto_compression/compressor.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/demo/auto_compression/detection/README.md b/demo/auto_compression/detection/README.md index e1777ce6..4c7dcc2a 100644 --- a/demo/auto_compression/detection/README.md +++ b/demo/auto_compression/detection/README.md @@ -95,7 +95,7 @@ tar -xf ppyoloe_crn_l_300e_coco.tar 使用run.py脚本得到模型的mAP: ``` -export CUDA_VISIBLE_DEVEICES=0 +export CUDA_VISIBLE_DEVICES=0 python run.py --config_path=./configs/ppyoloe_l_qat_dis.yaml --eval=True ``` @@ -105,7 +105,7 @@ python run.py --config_path=./configs/ppyoloe_l_qat_dis.yaml --eval=True 蒸馏量化自动压缩示例通过run.py脚本启动,会使用接口```paddleslim.auto_compression.AutoCompression```对模型进行自动压缩。配置config文件中模型路径、蒸馏、量化、和训练等部分的参数,配置完成后便可对模型进行量化和蒸馏。具体运行命令为: ``` -export CUDA_VISIBLE_DEVEICES=0 +export CUDA_VISIBLE_DEVICES=0 python run.py --config_path=./configs/ppyoloe_l_qat_dis.yaml --save_dir='./output/' ``` diff --git a/demo/auto_compression/image_classification/README.md b/demo/auto_compression/image_classification/README.md index 1192620b..1393e23b 100644 --- a/demo/auto_compression/image_classification/README.md +++ b/demo/auto_compression/image_classification/README.md @@ -69,7 +69,7 @@ tar -xf MobileNetV1_infer.tar ```shell # 单卡启动 -export CUDA_VISIBLE_DEVEICES=0 +export CUDA_VISIBLE_DEVICES=0 python run.py \ --model_dir='MobileNetV1_infer' \ --model_filename='inference.pdmodel' \ diff --git a/demo/auto_compression/image_classification/run.py b/demo/auto_compression/image_classification/run.py index 2e8f4274..8e3f2de7 100644 --- a/demo/auto_compression/image_classification/run.py +++ b/demo/auto_compression/image_classification/run.py @@ -92,7 +92,7 @@ if __name__ == '__main__': args = parser.parse_args() print_arguments(args) paddle.enable_static() - compress_config, train_config = load_config(args.config_path) + compress_config, train_config, _ = load_config(args.config_path) data_dir = args.data_dir train_reader = paddle.batch( diff --git a/demo/auto_compression/image_classification/run.sh b/demo/auto_compression/image_classification/run.sh index b28c9c49..52836db7 100644 --- a/demo/auto_compression/image_classification/run.sh +++ b/demo/auto_compression/image_classification/run.sh @@ -1,5 +1,5 @@ # 单卡启动 -export CUDA_VISIBLE_DEVEICES=0 +export CUDA_VISIBLE_DEVICES=0 python run.py \ --model_dir='MobileNetV1_infer' \ --model_filename='inference.pdmodel' \ diff --git a/demo/auto_compression/nlp/README.md b/demo/auto_compression/nlp/README.md index 891425e1..06587000 100644 --- a/demo/auto_compression/nlp/README.md +++ b/demo/auto_compression/nlp/README.md @@ -88,7 +88,7 @@ tar -zxvf afqmc.tar 数据集为CLUE,不同任务名称代表CLUE上不同的任务,可选择的任务名称有:afqmc, tnews, iflytek, ocnli, cmnli, cluewsc2020, csl。具体运行命令为 : ```shell -export CUDA_VISIBLE_DEVEICES=0 +export CUDA_VISIBLE_DEVICES=0 python run.py \ --model_type='ppminilm' \ --model_dir='./afqmc/' \ diff --git a/paddleslim/auto_compression/compressor.py b/paddleslim/auto_compression/compressor.py index 70f81108..bb2ea35b 100644 --- a/paddleslim/auto_compression/compressor.py +++ b/paddleslim/auto_compression/compressor.py @@ -36,7 +36,7 @@ _logger = get_logger(__name__, level=logging.INFO) try: if platform.system().lower() == 'linux': - from ..quant.quant_post_hpo import quant_post_hpo + from ..quant import quant_post_hpo except Exception as e: _logger.warning(e) -- GitLab