Skip to content

Commit 45bd0a5

Browse files
committed
more accurate to early stop train sparse model
1 parent 2294b81 commit 45bd0a5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

paddle/trainer/Tester.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ Tester::Tester(const std::shared_ptr<TrainerConfigHelper>& config,
4646
gradientMachine_(gradientMachine),
4747
parameterUpdater_(parameterUpdater),
4848
testDataProvider_(testDataProvider) {
49+
if (config_->getOptConfig().use_sparse_remote_updater()) {
50+
LOG(FATAL) << "It's prohibited to set sparse_remote_update "
51+
<< "in some layers if testing will be under going "
52+
<< "in the middle of training. You can do testing "
53+
<< "within separate process.";
54+
}
4955
testEvaluator_.reset(gradientMachine_->makeEvaluator());
5056
if (intconfig_->distributeTest) {
5157
testParameterClient_.reset(new ParameterClient2(true));

paddle/trainer/Trainer.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,6 @@ void Trainer::init(const std::shared_ptr<TrainerConfigHelper>& config,
226226
DataProvider::create(config_->getTestDataConfig(), *config_, gpuData));
227227
}
228228
if (testDataProvider_) {
229-
if (config_->getOptConfig().use_sparse_remote_updater()) {
230-
LOG(FATAL) << "It's prohibited to set sparse_remote_update "
231-
<< "in some layers if testing will be under going "
232-
<< "in the middle of training. You can do testing "
233-
<< "within separate process.";
234-
}
235229
createTester();
236230
}
237231

0 commit comments

Comments
 (0)