diff --git a/paddle/fluid/framework/dist_multi_trainer.cc b/paddle/fluid/framework/dist_multi_trainer.cc index 636e0a7354..481e12fcd6 100644 --- a/paddle/fluid/framework/dist_multi_trainer.cc +++ b/paddle/fluid/framework/dist_multi_trainer.cc @@ -73,6 +73,7 @@ void DistMultiTrainer::Finalize() { } pull_dense_worker_->Stop(); dataset_ptr_->DestroyReaders(); + root_scope_->DropKids(); } } // end namespace framework diff --git a/paddle/fluid/framework/executor.cc b/paddle/fluid/framework/executor.cc index 501480876b..239a3ce0a8 100644 --- a/paddle/fluid/framework/executor.cc +++ b/paddle/fluid/framework/executor.cc @@ -143,8 +143,6 @@ void Executor::RunFromDataset(const ProgramDesc& main_program, Scope* scope, trainer->Run(); VLOG(3) << "Trainer going to finalize"; trainer->Finalize(); - VLOG(3) << "Drop current scope kids"; - scope->DropKids(); return; } diff --git a/paddle/fluid/framework/multi_trainer.cc b/paddle/fluid/framework/multi_trainer.cc index 409c2f435f..3a266e4bda 100644 --- a/paddle/fluid/framework/multi_trainer.cc +++ b/paddle/fluid/framework/multi_trainer.cc @@ -76,6 +76,7 @@ void MultiTrainer::Finalize() { th.join(); } dataset_ptr_->DestroyReaders(); + root_scope_->DropKids(); } } // end namespace framework