Caffe regression wrong no. of outputs in final layer

128 Views Asked by At

I am doing regression using a fine-tuned net, on the lines of caffe flickr-style example, I have changed the num outputs in the last layer to 1, but when testing it on an image using the matlab wrapper function matcaffe_demo(). It returns 10 outputs corresponding to a single image while it should return only 1.

This is my final layer in 'deploy.prototxt'

layer {
  name: "my-fc8"
  type: "InnerProduct"
  bottom: "fc7"
  top: "my-fc8"
  # lr_mult is set to higher than for other layers, because this layer is starting from random while the others are already trained
  param {
    lr_mult: 10
    decay_mult: 1
  }      
  param {
    lr_mult: 20
    decay_mult: 0
  }
  inner_product_param {
    num_output: 1
    weight_filler {
    type: "gaussian"
    std: 0.01
  }
  bias_filler {
    type: "constant"
    value: 0
  }
}

As one can see, the num_outputs is 1, the problem is when I test the finetuned net on an image using matcaffe_demo(), it gives 10 output labels instead of 1. Can anyone help me understand what is happening here. Thanks in advance.

0

There are 0 best solutions below