From 8a0ba0fd405ebdd1aa247695edf20b991b9e7b98 Mon Sep 17 00:00:00 2001 From: Jeff Donahue Date: Wed, 9 Jul 2014 14:25:55 -0700 Subject: [PATCH] use layer_param instead of layers_[layer_id]->layer_param() --- src/caffe/net.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/caffe/net.cpp b/src/caffe/net.cpp index c0f124b..0b9cc84 100644 --- a/src/caffe/net.cpp +++ b/src/caffe/net.cpp @@ -88,7 +88,7 @@ void Net::Init(const NetParameter& in_param) { << top_vecs_[layer_id][top_id]->count() << ")"; } DLOG(INFO) << "Memory required for data: " << memory_used_ * sizeof(Dtype); - const int blobs_lr_size = layers_[layer_id]->layer_param().blobs_lr_size(); + const int blobs_lr_size = layer_param.blobs_lr_size(); const int num_param_blobs = layers_[layer_id]->blobs().size(); CHECK(blobs_lr_size == num_param_blobs || blobs_lr_size == 0) << "Incorrect blobs lr size: should be either 0 " @@ -96,8 +96,7 @@ void Net::Init(const NetParameter& in_param) { if (blobs_lr_size) { // Check if this layer needs backward operation itself for (int param_id = 0; param_id < blobs_lr_size; ++param_id) { - need_backward |= - (layers_[layer_id]->layer_param().blobs_lr(param_id) > 0); + need_backward |= layer_param.blobs_lr(param_id) > 0; } } else if (layers_[layer_id]->blobs().size()) { // catch: if a layer param does not specify blobs_lr, we should assume the -- 2.7.4