Message type "caffe.LayerParameter" has no field named "threshold".

81 views
Skip to first unread message

Ali MassahKiani

unread,
Jun 23, 2017, 8:16:27 AM6/23/17
to Caffe Users
i want use Threshold Layer with t=0.5 but when i run caffe this error occur :
[libprotobuf ERROR C:\Users\guillaume\work\caffe-builder\build_v140_x64\packages\protobuf\protobuf_download-prefix\src\protobuf_download\src\google\protobuf\text_format.cc:298] Error parsing text-format caffe.NetParameter: 161:12: Message type "caffe.LayerParameter" has no field named "threshold".
F0623
16:41:23.631153  4996 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: D:/Deep/eye/caffe/lenet_train_test.prototxt

my defined network :

layer {
  name
: "Sigmoid1"
  type
: "Sigmoid"
  bottom
: "ip2"
  top
: "ip3"
}
layer
{
  name
: "Threshold1"
  type
: "Threshold"
  threshold
: 0.5
  bottom
: "ip3"
  top
: "ip4"
}
why this error occur?

Przemek D

unread,
Jun 26, 2017, 4:33:36 AM6/26/17
to Caffe Users
As any layer, the Threshold Layer does not input any parameters directly. Instead, it takes a parameter structure, within which all the parameters are defined. That is, just like Convolution layer has convolution_param and InnerProduct has inner_product_param, so the Threshold has threshold_param. So you should do something like that instead:
layer {
  name
: "..."
  type
: "Threshold"
  bottom
: "..."
  top
: "..."
  threshold_param
{
    threshold
: <value>
 
}
}
Reply all
Reply to author
Forward
0 new messages