From f53e8d7a09eacea7d6c1637d4002cf3ad670adbc Mon Sep 17 00:00:00 2001 From: wangyanfei01 Date: Wed, 14 Dec 2016 18:31:37 +0800 Subject: [PATCH] fix bug: if test and sparse_remote_update can not co-exsit, crash trainer if necessary --- paddle/trainer/Trainer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paddle/trainer/Trainer.cpp b/paddle/trainer/Trainer.cpp index 9c83c207ede..e10984a8d15 100644 --- a/paddle/trainer/Trainer.cpp +++ b/paddle/trainer/Trainer.cpp @@ -226,6 +226,12 @@ 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