From 0712611256f326edd48b8bb6a6d64a5571266795 Mon Sep 17 00:00:00 2001 From: XGZhang <46363693+XGZhang11@users.noreply.github.com> Date: Fri, 3 Sep 2021 13:58:20 +0800 Subject: [PATCH] fix a quantization bug (#35407) --- .../paddle/fluid/contrib/slim/quantization/imperative/qat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/contrib/slim/quantization/imperative/qat.py b/python/paddle/fluid/contrib/slim/quantization/imperative/qat.py index 6208b43c9e..790eff04c3 100644 --- a/python/paddle/fluid/contrib/slim/quantization/imperative/qat.py +++ b/python/paddle/fluid/contrib/slim/quantization/imperative/qat.py @@ -202,7 +202,7 @@ class ImperativeQuantAware(object): self._quantize_inputs = ImperativeQuantizeInputs(**kwargs) - self._quantize_outputs = ImperativeQuantizeOutputs() + self._quantize_outputs = ImperativeQuantizeOutputs(moving_rate) def quantize(self, model): """ @@ -413,6 +413,8 @@ class ImperativeQuantizeOutputs(object): "The model must be the instance of dygraph.Layer." for cur_name, cur_layer in model.named_sublayers(): + if '_act_preprocess' in cur_name: + continue if not self._is_target_layer(cur_layer): continue -- GitLab