set_lr_mult and error "libprotobuf ... repeated_field.h:832] CHECK failed: (index) < (size()"

20 views
Skip to first unread message

Huynh Vu

unread,
Aug 11, 2017, 3:19:28 AM8/11/17
to Caffe Users
Hi everyone,

I'm setting the lr_mult of one layer using the following codes

      LayerParameter* conv_param = new LayerParameter();
      conv_param->mutable_convolution_param()->set_num_output(50);
      conv_param->mutable_convolution_param()->set_kernel_size(5);
      conv_param->mutable_convolution_param()->set_stride(1);
      conv_param->mutable_convolution_param()->set_pad(0);
      conv_param->mutable_param(0)->set_lr_mult(10);
      conv_param->mutable_param(0)->set_decay_mult(1);


The program got the error at the above red line.
[libprotobuf FATAL /usr/include/google/protobuf/repeated_field.h:832] CHECK failed: (index) < (size()):
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: (index) < (size()):

Hope to get your support on the issue.

Best regards

Shai Bagon

unread,
Aug 14, 2017, 5:59:48 AM8/14/17
to Caffe Users
I think you need to make sure param exists, otherwise you need to add it.

Huynh Vu

unread,
Aug 14, 2017, 9:47:50 PM8/14/17
to Caffe Users
Thank Shai,

After i added the parameter using

conv_s1_param.mutable_param()->Add();conv_s1_param.mutable_param()->Add();

The problem is solved.

Best regards
Reply all
Reply to author
Forward
0 new messages