From 5ffcefb17fed72dcd41348114800688696f905a0 Mon Sep 17 00:00:00 2001 From: Bai Yifan Date: Sat, 15 Aug 2020 11:10:05 +0800 Subject: [PATCH] change paddle required version to 1.8.4 (#420) --- paddleslim/quant/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/paddleslim/quant/__init__.py b/paddleslim/quant/__init__.py index 38ca531c..3c9a52ed 100644 --- a/paddleslim/quant/__init__.py +++ b/paddleslim/quant/__init__.py @@ -15,17 +15,25 @@ import logging import paddle.fluid as fluid +import paddle.version as fluid_version from ..common import get_logger _logger = get_logger(__name__, level=logging.INFO) try: - fluid.require_version('2.0.0') + fluid.require_version('1.8.4') + version_installed = [ + fluid_version.major, fluid_version.minor, fluid_version.patch, + fluid_version.rc + ] + assert version_installed != [ + '2', '0', '0-alpha0', '0' + ], "training-aware and post-training quant is not supported in 2.0 alpha version paddle" from .quanter import quant_aware, convert, quant_post_static, quant_post_dynamic from .quanter import quant_post, quant_post_only_weight except Exception as e: _logger.warning( "If you want to use training-aware and post-training quantization, " - "please use Paddle >= 2.0.0 or develop version") + "please use Paddle >= 1.8.4 or develop version") from .quant_embedding import quant_embedding -- GitLab