caffe 检查失败:kernel_size 指定了 2 次; 0 空间暗淡

caffe check failed: kernel_size specified 2 times; 0 spatial dims

我有一个 caffe "Check failed" 错误为:

...
I0415 15:35:30.497133 39410 net.cpp:129] Top shape: 1 4096 (4096)
I0415 15:35:30.497135 39410 net.cpp:137] Memory required for data: 2898304
I0415 15:35:30.497138 39410 layer_factory.hpp:77] Creating layer conv1
I0415 15:35:30.497155 39410 net.cpp:84] Creating Layer conv1
I0415 15:35:30.497169 39410 net.cpp:406] conv1 <- ReLU0
I0415 15:35:30.497174 39410 net.cpp:380] conv1 -> conv1
F0415 15:35:30.497185 39410 base_conv_layer.cpp:35] Check failed: num_kernel_dims == 1 || num_kernel_dims == num_spatial_axes_ kernel_size must be specified once, or once per spatial dimension (kernel_size specified 2 times; 0 spatial dims).

这里是 proto.txt 文件的一小部分:

...
layer {
  name: "loss0"
  type: "EuclideanLoss"
  bottom: "ampl0"
  bottom: "label_b4_noise"
  top: "loss0"
}
layer {
  name: "ReLU0"
  type: "ReLU"
  bottom: "ampl0"
  top: "ReLU0"
  relu_param {
    negative_slope: 0
  }
}
layer {
  name: "conv1"
  type: "Convolution"
  bottom: "ReLU0"
  top: "conv1"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  convolution_param {
    num_output: 16
    bias_term: false
    pad: 0
    pad: 0
    kernel_size: 1
    kernel_size: 5
    group: 1
    stride: 1
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0.0
    }
    axis: 1
  }
}
...

你能告诉我为什么 "Check failed" 吗?

"kernel_size specified 2 times; 0 spatial dims" 是什么意思?

这里有什么num_spatial_axes_kernel_size? 对不起,如果我的问题很简单。

查看图层 ("ReLU0") 的输入:

I0415 15:35:30.497133 39410 net.cpp:129] Top shape: 1 4096 (4096)

它的尺寸是 1x4096,也就是说,它有 1 个批次,有 4096 个通道,no 宽度和 no 高度(即宽度和高度是通常被忽略的单例维度。
现在您要应用 "conv1" 一个 1x5 内核。您想如何对没有空间维度的斑点应用卷积?!

这是你从 caffe 得到的错误:你为 conv kernel 指定了 2 个空间维度(你指定了 kernel_size 两次)但是你的输入 blob 根本没有空间维度,那就是它的 num_spatial_axes_==0.