caffe 中的旧 prototxt 语法

Old prototxt syntax in caffe

我正在使用一些较旧的 caffe 分支。现在我需要通过切片输入层来修改prototxt文件。

我知道在新语法中它看起来像这样:

layer {
  name: "slice"
  type: "Slice"
  bottom: "labelAndMask"
  ## Example of layer with a shape N x 5 x Height x Width
  top: "label"
  top: "mask"
  slice_param {
    axis: 1
    slice_point: 1
  }
}

旧的 prototxt 格式的等价物是什么?另外,caffe源码哪里可以自己查?

您应该查看 $CAFFE_ROOT/src/caffe/proto/caffe.proto 的底部,您会看到 V1LayerParameter 定义。

对于旧语法切片层:

layers {
  type: SLICE # this is NOT a string, but an enum
  name: "slice"
  bottom: "labelAndMask"
  ## Example of layer with a shape N x 5 x Height x Width
  top: "label"
  top: "mask"
  slice_param {
    axis: 1
    slice_point: 1
  }
}