From cd5f11b8226289a30448258b92f08329e126b534 Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Wed, 13 Jan 2021 20:14:20 +0800 Subject: [PATCH] Decrease Batch Size for Windows CI, test=develop (#30331) As the title --- .../fluid/tests/unittests/dygraph_to_static/CMakeLists.txt | 4 ---- .../fluid/tests/unittests/dygraph_to_static/test_tsm.py | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt b/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt index 5bfdb97def6..1bf762ab1a1 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt @@ -1,10 +1,6 @@ file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py") string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") -if(WIN32) - LIST(REMOVE_ITEM TEST_OPS test_tsm) -endif() - foreach(TEST_OP ${TEST_OPS}) py_test_modules(${TEST_OP} MODULES ${TEST_OP}) endforeach(TEST_OP) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py index c9d4bb2e79d..7ca0a1a539e 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tsm.py @@ -214,7 +214,8 @@ class FakeDataReader(object): self.img_std = np.array(cfg.MODEL.image_std).reshape( [3, 1, 1]).astype(np.float32) - self.batch_size = cfg[mode.upper()]['batch_size'] + self.batch_size = 1 if sys.platform == 'darwin' or os.name == 'nt' else cfg[ + mode.upper()]['batch_size'] self.generator_out = [] self.total_iter = 3 for i in range(self.total_iter): @@ -240,7 +241,8 @@ class FakeDataReader(object): def create_optimizer(cfg, params): total_videos = cfg.total_videos - step = int(total_videos / cfg.batch_size + 1) + batch_size = 1 if sys.platform == 'darwin' or os.name == 'nt' else cfg.batch_size + step = int(total_videos / batch_size + 1) bd = [e * step for e in cfg.decay_epochs] base_lr = cfg.learning_rate lr_decay = cfg.learning_rate_decay -- GitLab