From 209a3f4e095c6a3ca2d7684e667da15d8bffe00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=9F=E9=A3=9E=E8=B7=83?= <34468585+zhaify@users.noreply.github.com> Date: Mon, 10 Jun 2019 10:46:50 +0800 Subject: [PATCH] add log into slim mkldnn int8 test (#17926) --- .../slim/tests/test_mkldnn_int8_quantization_strategy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/contrib/slim/tests/test_mkldnn_int8_quantization_strategy.py b/python/paddle/fluid/contrib/slim/tests/test_mkldnn_int8_quantization_strategy.py index 5f10b32812..01c8f893fa 100644 --- a/python/paddle/fluid/contrib/slim/tests/test_mkldnn_int8_quantization_strategy.py +++ b/python/paddle/fluid/contrib/slim/tests/test_mkldnn_int8_quantization_strategy.py @@ -129,7 +129,7 @@ class TestMKLDNNPostTrainingQuantStrategy(unittest.TestCase): top1 = 0.0 top5 = 0.0 total_samples = 0 - for _, data in enumerate(test_reader()): + for batch_id, data in enumerate(test_reader()): if six.PY2: images = map(lambda x: x[0].reshape(dshape), data) if six.PY3: @@ -146,6 +146,9 @@ class TestMKLDNNPostTrainingQuantStrategy(unittest.TestCase): top1 += np.sum(out[1]) * len(data) top5 += np.sum(out[2]) * len(data) total_samples += len(data) + if (batch_id + 1) % 100 == 0: + _logger.info('{} images have been predicted'.format( + total_samples)) return top1 / total_samples, top5 / total_samples def _warmup(self, reader=None, config_path=''): -- GitLab