我有一个5D的blob,类似于1x8x128x128
,我有一个卷积层可以处理这个5D blob。但是当我想使用池化层时,它就不能正常工作了。怎么才能在一个5D的blob上使用pooling
层呢?
检查失败:4 == bottom[0]->num_axes() (4 vs. 5) 输入必须有4维,对应于(num, channels, height, width)
我认为Caffe还没有支持这个功能。我能否只使用卷积层并进行池化处理呢?
我有一个5D的blob,类似于1x8x128x128
,我有一个卷积层可以处理这个5D blob。但是当我想使用池化层时,它就不能正常工作了。怎么才能在一个5D的blob上使用pooling
层呢?
检查失败:4 == bottom[0]->num_axes() (4 vs. 5) 输入必须有4维,对应于(num, channels, height, width)
我认为Caffe还没有支持这个功能。我能否只使用卷积层并进行池化处理呢?
如果你只想汇集前两个空间维度,可以通过"Reshape"
到4D("压缩"通道和时间维度),进行汇集,然后再通过"Reshape"
回到5D:
layer {
name: "pool/reshape4D"
type: "Reshape"
bottom: "in"
top: "pool/reshape4D"
reshape_param { axis: 1 num_axes: 1 shape { dim: -1 } }
}
layer {
name: "pool"
type: "Pooling"
bottom: "pool/reshape4D"
top: "pool"
# pooling params here...
}
layer {
name: "pool/reshape5D"
type: "Reshape"
bottom: "pool"
top: "pool/reshape5D"
reshape_param { axis: 1 num_axes: 1 shape { dim: -1 dim: <temporal_dim> } } # replace <.> with the actual temporal dimension size.
}
有关详细信息,请参见caffe.proto
中ReshapeParameter
的定义。
Softmax
,如果可能的话。但我也会在这里尝试这个答案!谢谢!@Shai - user4911648