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 5bfdb97def693863a627cad212e2ce5d5fc72153..1bf762ab1a10b6df077cdbd067e8bc81a8ad2345 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 c9d4bb2e79deebb5edf153efd09e18ba9bbab833..7ca0a1a539e38299ef81d4a58f82c4a4dfd1e5fb 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