From 5e661982a3acccf0d5eba2b998f3d4c0ba64ebcc Mon Sep 17 00:00:00 2001 From: Liufang Sang Date: Fri, 21 Feb 2020 04:09:11 -0600 Subject: [PATCH] fix install for paddle 1.6 (#135) --- paddleslim/quant/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/paddleslim/quant/__init__.py b/paddleslim/quant/__init__.py index 5f5f9a30..93680765 100644 --- a/paddleslim/quant/__init__.py +++ b/paddleslim/quant/__init__.py @@ -12,5 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .quanter import quant_aware, quant_post, convert +import logging + +import paddle.fluid as fluid +from ..common import get_logger + +_logger = get_logger(__name__, level=logging.INFO) + +try: + fluid.require_version('1.7.0') + from .quanter import quant_aware, quant_post, convert +except Exception as e: + _logger.warning( + "If you want to use training-aware and post-training quantization, " + "please use Paddle >= 1.7.0 or develop version") + from .quant_embedding import quant_embedding -- GitLab