From 5f30e57cdd12239488fba2985ae0d6d2be2a92cc Mon Sep 17 00:00:00 2001 From: lilong12 Date: Thu, 30 Jul 2020 16:50:33 +0800 Subject: [PATCH] fix test_pipeline, test=develop (#25808) * fix test_pipeline, test=develop --- paddle/fluid/framework/device_worker.h | 1 + paddle/fluid/framework/pipeline_trainer.cc | 1 + python/paddle/fluid/tests/unittests/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/device_worker.h b/paddle/fluid/framework/device_worker.h index d6d53a88580..07470ef8532 100644 --- a/paddle/fluid/framework/device_worker.h +++ b/paddle/fluid/framework/device_worker.h @@ -335,6 +335,7 @@ class SectionWorker : public DeviceWorker { void SetSkipVars(const std::vector& skip_vars) { skip_vars_ = skip_vars; } + static void ResetBatchId() { batch_id_ = 0; } static std::atomic cpu_id_; diff --git a/paddle/fluid/framework/pipeline_trainer.cc b/paddle/fluid/framework/pipeline_trainer.cc index 379892ecfd1..758b728fd9c 100644 --- a/paddle/fluid/framework/pipeline_trainer.cc +++ b/paddle/fluid/framework/pipeline_trainer.cc @@ -250,6 +250,7 @@ void PipelineTrainer::Finalize() { } } root_scope_->DropKids(); + SectionWorker::ResetBatchId(); } Scope* PipelineTrainer::GetWorkerScope(int thread_id) { diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 710376de56b..9d11bbc607a 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -248,7 +248,6 @@ list(REMOVE_ITEM TEST_OPS test_fuse_bn_act_pass) list(REMOVE_ITEM TEST_OPS test_imperative_static_runner_mnist) list(REMOVE_ITEM TEST_OPS test_imperative_static_runner_while) list(REMOVE_ITEM TEST_OPS test_conv3d_transpose_op) -list(REMOVE_ITEM TEST_OPS test_pipeline) # disable this unittest temporarily list(REMOVE_ITEM TEST_OPS test_imperative_data_loader_exception) -- GitLab