Repository: incubator-singa Updated Branches: refs/heads/master ae2030362 -> 50deedd49
SINGA-66 Fix bugs in Worker::RunOneBatch function and ClusterProto Add checks for test_net_ and validation_net_ (!=nullptr) before conduct testing and validation. Set default values (1) to nworker_groups and nserver_groups. Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/50deedd4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/50deedd4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/50deedd4 Branch: refs/heads/master Commit: 50deedd496182daa0c178dd2581af43d173b6506 Parents: ae20303 Author: wangwei <[email protected]> Authored: Fri Sep 4 19:35:55 2015 +0800 Committer: wangwei <[email protected]> Committed: Fri Sep 4 19:35:55 2015 +0800 ---------------------------------------------------------------------- src/proto/job.proto | 4 ++-- src/trainer/worker.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/50deedd4/src/proto/job.proto ---------------------------------------------------------------------- diff --git a/src/proto/job.proto b/src/proto/job.proto index dcee10b..9adae6d 100644 --- a/src/proto/job.proto +++ b/src/proto/job.proto @@ -117,8 +117,8 @@ message UpdaterProto { } message ClusterProto { - optional int32 nworker_groups = 1; - optional int32 nserver_groups = 2; + optional int32 nworker_groups = 1 [default = 1]; + optional int32 nserver_groups = 2 [default = 1]; optional int32 nworkers_per_group = 3 [default = 1]; optional int32 nservers_per_group = 4 [default = 1]; optional int32 nworkers_per_procs = 5 [default = 1]; http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/50deedd4/src/trainer/worker.cc ---------------------------------------------------------------------- diff --git a/src/trainer/worker.cc b/src/trainer/worker.cc index 8ab5bba..bcdde55 100644 --- a/src/trainer/worker.cc +++ b/src/trainer/worker.cc @@ -162,12 +162,12 @@ void Worker::Run() { InitLocalParams(); Metric perf; while (!StopNow(step_)) { - if (ValidateNow(step_)) { + if (ValidateNow(step_) && validation_net_ != nullptr) { //LOG(ERROR)<<"Validation at step "<<step; CollectAll(validation_net_, step_); Test(job_conf_.valid_steps(), kValidation, validation_net_); } - if (TestNow(step_)) { + if (TestNow(step_) && test_net_ != nullptr) { //LOG(ERROR)<<"Test at step "<<step; CollectAll(test_net_, step_); Test(job_conf_.test_steps(), kTest, test_net_);
