From 9bf90922936114d1848ce56716a5828c50fcf5ba Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Sat, 24 Apr 2021 11:14:25 +0800 Subject: [PATCH] Fix test_yolov3 Random Failure (#32496) Reduce max iter size to fix windows openblas test_yolov3 random failure. Decrease batch size to fix pe related unittest random failure. --- python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py | 2 +- python/paddle/fluid/tests/unittests/seresnext_net.py | 2 +- .../paddle/fluid/tests/unittests/test_parallel_executor_crf.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py index 528e388f6a2..bb95bdf9fc6 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/yolov3.py @@ -97,7 +97,7 @@ cfg.batch_size = 1 if sys.platform == 'darwin' or os.name == 'nt' else 4 # derived learning rate the to get the final learning rate. cfg.learning_rate = 0.001 # maximum number of iterations -cfg.max_iter = 20 if fluid.is_compiled_with_cuda() else 2 +cfg.max_iter = 20 if fluid.is_compiled_with_cuda() else 1 # Disable mixup in last N iter cfg.no_mixup_iter = 10 if fluid.is_compiled_with_cuda() else 1 # warm up to learning rate diff --git a/python/paddle/fluid/tests/unittests/seresnext_net.py b/python/paddle/fluid/tests/unittests/seresnext_net.py index 2e4b1828c5b..1f02562dcb4 100644 --- a/python/paddle/fluid/tests/unittests/seresnext_net.py +++ b/python/paddle/fluid/tests/unittests/seresnext_net.py @@ -173,7 +173,7 @@ model = SE_ResNeXt50Small def batch_size(use_device): if use_device == DeviceType.CUDA: # Paddle uses 8GB P4 GPU for unittest so we decreased the batch size. - return 8 + return 4 return 12 diff --git a/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py b/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py index ea59a7f584a..47d286fb6ab 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py +++ b/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py @@ -159,7 +159,7 @@ class TestCRFModel(unittest.TestCase): train_data = paddle.batch( paddle.reader.shuffle( paddle.dataset.conll05.test(), buf_size=8192), - batch_size=16) + batch_size=8) place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace() exe = fluid.Executor(place) -- GitLab