From a125697e2cd5459607080a64dcac5de7c96a5849 Mon Sep 17 00:00:00 2001 From: Qi Li Date: Tue, 2 Jun 2020 15:36:17 +0800 Subject: [PATCH] fix ut test_recognize_digits (#24794) --- paddle/fluid/train/test_train_recognize_digits.cc | 1 + python/paddle/fluid/tests/book/test_recognize_digits.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/train/test_train_recognize_digits.cc b/paddle/fluid/train/test_train_recognize_digits.cc index bd2a439f6a..45c438e892 100644 --- a/paddle/fluid/train/test_train_recognize_digits.cc +++ b/paddle/fluid/train/test_train_recognize_digits.cc @@ -19,6 +19,7 @@ limitations under the License. */ #include "gtest/gtest.h" #include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/io/fs.h" #include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/tensor_util.h" diff --git a/python/paddle/fluid/tests/book/test_recognize_digits.py b/python/paddle/fluid/tests/book/test_recognize_digits.py index 3b2c4af8ae..4fbb146752 100644 --- a/python/paddle/fluid/tests/book/test_recognize_digits.py +++ b/python/paddle/fluid/tests/book/test_recognize_digits.py @@ -123,8 +123,8 @@ def train(nn_type, # get test acc and loss acc_val = numpy.array(acc_set).mean() avg_loss_val = numpy.array(avg_loss_set).mean() - if float(acc_val - ) > 0.2: # Smaller value to increase CI speed + if float(acc_val) > 0.2 or pass_id == (PASS_NUM - 1): + # Smaller value to increase CI speed if save_dirname is not None: fluid.io.save_inference_model( save_dirname, ["img"], [prediction], -- GitLab