diff --git a/paddle/fluid/inference/tests/book/CMakeLists.txt b/paddle/fluid/inference/tests/book/CMakeLists.txt index cddd5a786c45c804014d82012ec3a7ef988491a5..c0aba39b97770886cf95456e9876d3cc7ff92266 100644 --- a/paddle/fluid/inference/tests/book/CMakeLists.txt +++ b/paddle/fluid/inference/tests/book/CMakeLists.txt @@ -27,7 +27,7 @@ endfunction(inference_test) inference_test(fit_a_line) inference_test(image_classification ARGS vgg resnet) inference_test(label_semantic_roles) -inference_test(recognize_digits ARGS mlp) +inference_test(recognize_digits ARGS mlp conv) inference_test(recommender_system) #inference_test(rnn_encoder_decoder) inference_test(understand_sentiment) diff --git a/paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc b/paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc index bd7194891618498154fc254b5eada591f9dac3a6..99bee94cb82633219df7a4a5c5bada15d2d3ce64 100644 --- a/paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc +++ b/paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc @@ -77,7 +77,7 @@ TEST(inference, recognize_digits_combine) { // Use normilized image pixels as input data, // which should be in the range [-1.0, 1.0]. SetupTensor( - input, {1, 28, 28}, static_cast(-1), static_cast(1)); + input, {1, 1, 28, 28}, static_cast(-1), static_cast(1)); std::vector cpu_feeds; cpu_feeds.push_back(&input); diff --git a/python/paddle/v2/fluid/tests/book/test_recognize_digits.py b/python/paddle/v2/fluid/tests/book/test_recognize_digits.py index a0b4774da5fbaca6095392e42d5c607f79461957..2462d425e16c40f2fa3b0944311aea4f44de3ac4 100644 --- a/python/paddle/v2/fluid/tests/book/test_recognize_digits.py +++ b/python/paddle/v2/fluid/tests/book/test_recognize_digits.py @@ -141,7 +141,7 @@ def train(nn_type, use_cuda, parallel, save_dirname, save_param_filename): # 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.85: # test acc > 85% + if float(acc_val) > 0.2: # Smaller value to increase CI speed if save_dirname is not None: fluid.io.save_inference_model( save_dirname, ["img"], [prediction], @@ -235,8 +235,9 @@ def inject_all_tests(): for nn_type in ('mlp', 'conv'): inject_test_method(use_cuda, parallel, nn_type, True) - # One unit-test for saving parameters as separate files + # Two unit-test for saving parameters as separate files inject_test_method(False, False, 'mlp', False) + inject_test_method(False, False, 'conv', False) inject_all_tests()