From 3ae057aca4382b9156cf0129b59d03bd7da306f8 Mon Sep 17 00:00:00 2001 From: ceci3 Date: Tue, 14 Jun 2022 15:51:00 +0800 Subject: [PATCH] fix ac import ptq_hpo (#1170) --- paddleslim/auto_compression/compressor.py | 6 +++--- paddleslim/quant/__init__.py | 2 +- paddleslim/quant/{quant_post_hpo.py => post_quant_hpo.py} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename paddleslim/quant/{quant_post_hpo.py => post_quant_hpo.py} (100%) diff --git a/paddleslim/auto_compression/compressor.py b/paddleslim/auto_compression/compressor.py index 72dd3485..4d47ee10 100644 --- a/paddleslim/auto_compression/compressor.py +++ b/paddleslim/auto_compression/compressor.py @@ -35,7 +35,7 @@ _logger = get_logger(__name__, level=logging.INFO) try: if platform.system().lower() == 'linux': - from ..quant import quant_post_hpo + from ..quant import post_quant_hpo except Exception as e: _logger.warning(e) @@ -409,7 +409,7 @@ class AutoCompression: if strategy == 'ptq_hpo' and config.max_quant_count == 1 and platform.system( ).lower() == 'linux': - ptq_loss = quant_post_hpo.g_min_emd_loss + ptq_loss = post_quant_hpo.g_min_emd_loss final_quant_config = get_final_quant_config(ptq_loss) if final_quant_config is not None: @@ -468,7 +468,7 @@ class AutoCompression: raise NotImplementedError( "post-quant-hpo is not support in system other than linux") - quant_post_hpo.quant_post_hpo( + post_quant_hpo.quant_post_hpo( self._exe, self._places, model_dir=self.model_dir, diff --git a/paddleslim/quant/__init__.py b/paddleslim/quant/__init__.py index 808a9abc..e4d59b94 100644 --- a/paddleslim/quant/__init__.py +++ b/paddleslim/quant/__init__.py @@ -34,7 +34,7 @@ try: from .quanter import quant_post, quant_post_only_weight from .quant_aware_with_infermodel import quant_aware_with_infermodel, export_quant_infermodel if platform.system().lower() == 'linux': - from .quant_post_hpo import quant_post_hpo + from .post_quant_hpo import quant_post_hpo else: _logger.warning( "post-quant-hpo is not support in system other than linux") diff --git a/paddleslim/quant/quant_post_hpo.py b/paddleslim/quant/post_quant_hpo.py similarity index 100% rename from paddleslim/quant/quant_post_hpo.py rename to paddleslim/quant/post_quant_hpo.py -- GitLab