How to add a custom python loss layer?

26 views
Skip to first unread message

ABHISHEK SETHI

unread,
Jun 22, 2018, 5:25:02 AM6/22/18
to Caffe Users
I added a custom loss layer and made changes in the prototxt file as folows but I am getting the following error.

## modified loss layer
layers {
  type: PYTHON
  name: 'loss'
  bottom: "ip2"
  bottom: "label"
  top: "loss"
  python_param {
    module: 'loss_layers'
    layer: 'EuclideanLossLayer'
  }
  loss_weight: 1
}

ERROR:

Error parsing text-format caffe.NetParameter: 294:3: Unknown enumeration value of "PYTHON" for field "type"

Przemek D

unread,
Aug 22, 2018, 3:23:02 AM8/22/18
to Caffe Users
It looks like you're using old syntax. Modern prototxt should look like this instead:
layer {
  type
: "Python"
  name
: "loss"
 
...
}
Note the singular "layer" and "Python" in double quotes with only first letter capitalized.
Reply all
Reply to author
Forward
0 new messages