From 45bd0a5e167ae7910ddfa36aa764b4738949c4c2 Mon Sep 17 00:00:00 2001 From: wangyanfei01 Date: Thu, 15 Dec 2016 11:58:12 +0800 Subject: [PATCH] more accurate to early stop train sparse model --- paddle/trainer/Tester.cpp | 6 ++++++ paddle/trainer/Trainer.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/paddle/trainer/Tester.cpp b/paddle/trainer/Tester.cpp index 97d1b53934b..24f72717348 100644 --- a/paddle/trainer/Tester.cpp +++ b/paddle/trainer/Tester.cpp @@ -46,6 +46,12 @@ Tester::Tester(const std::shared_ptr& config, gradientMachine_(gradientMachine), parameterUpdater_(parameterUpdater), testDataProvider_(testDataProvider) { + if (config_->getOptConfig().use_sparse_remote_updater()) { + LOG(FATAL) << "It's prohibited to set sparse_remote_update " + << "in some layers if testing will be under going " + << "in the middle of training. You can do testing " + << "within separate process."; + } testEvaluator_.reset(gradientMachine_->makeEvaluator()); if (intconfig_->distributeTest) { testParameterClient_.reset(new ParameterClient2(true)); diff --git a/paddle/trainer/Trainer.cpp b/paddle/trainer/Trainer.cpp index 1380e464400..85610ec04e3 100644 --- a/paddle/trainer/Trainer.cpp +++ b/paddle/trainer/Trainer.cpp @@ -226,12 +226,6 @@ void Trainer::init(const std::shared_ptr& config, DataProvider::create(config_->getTestDataConfig(), *config_, gpuData)); } if (testDataProvider_) { - if (config_->getOptConfig().use_sparse_remote_updater()) { - LOG(FATAL) << "It's prohibited to set sparse_remote_update " - << "in some layers if testing will be under going " - << "in the middle of training. You can do testing " - << "within separate process."; - } createTester(); } -- GitLab