11

根据 kaggle 面部关键点竞赛,我从输入图像中提取 30 个面部关键点 (x,y)。

我如何设置 caffe 来运行回归并产生 30 维输出?

Input: 96x96 image
Output: 30 - (30 dimensions).

我如何相应地设置咖啡?我正在使用 EUCLIDEAN_LOSS(平方和)来获得回归输出。这是一个使用 caffe 的简单逻辑回归模型,但它不起作用。看起来准确度层无法处理多标签输出。

I0120 17:51:27.039113  4113 net.cpp:394] accuracy <- label_fkp_1_split_1
I0120 17:51:27.039135  4113 net.cpp:356] accuracy -> accuracy
I0120 17:51:27.039158  4113 net.cpp:96] Setting up accuracy
F0120 17:51:27.039201  4113 accuracy_layer.cpp:26] Check failed: bottom[1]->channels() == 1 (30 vs. 1) 
*** Check failure stack trace: ***
    @     0x7f7c2711bdaa  (unknown)
    @     0x7f7c2711bce4  (unknown)
    @     0x7f7c2711b6e6  (unknown)

这是图层文件:

name: "LogReg"
layers {
  name: "fkp"
  top: "data"
  top: "label"
  type: HDF5_DATA
  hdf5_data_param {
   source: "train.txt"
   batch_size: 100
  }
    include: { phase: TRAIN }

}

layers {
  name: "fkp"
  type: HDF5_DATA
  top: "data"
  top: "label"
  hdf5_data_param {
    source: "test.txt"
    batch_size: 100
  }

  include: { phase: TEST }
}

layers {
  name: "ip"
  type: INNER_PRODUCT
  bottom: "data"
  top: "ip"
  inner_product_param {
    num_output: 30
  }
}
layers {
  name: "loss"
  type: EUCLIDEAN_LOSS
  bottom: "ip"
  bottom: "label"
  top: "loss"
}

layers {
  name: "accuracy"
  type: ACCURACY
  bottom: "ip"
  bottom: "label"
  top: "accuracy"
  include: { phase: TEST }
}
4

1 回答 1

4

我找到了 :)

我将 SOFTLAYER 替换为 EUCLIDEAN_LOSS 函数并更改了输出数量。有效。

layers {
  name: "loss"
  type: EUCLIDEAN_LOSS
  bottom: "ip1"
  bottom: "label"
  top: "loss"
}

HINGE_LOSS 也是另一种选择。

于 2015-02-06T15:36:26.367 回答