我有一个像 1x8x128x128
这样的 5D blob,并且我有一个能够处理我的 5D blob 的卷积层。当我想使用池层时,尽管它不起作用。如何将池层
与 5D blob 一起使用?
Check failed: 4 == bottom[0]->num_axes() (4 vs. 5) Input must have 4 axes, corresponding to (num, channels, height, width)
我认为caffe还不支持它。我可以只使用卷积层并进行池化吗?
最佳答案
如果您只想池化前两个空间维度,您可以“ reshape ”
为 4D(“挤压” channel 和时间维度),池化,然后“ 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
的定义了解更多详情。
关于machine-learning - caffe:5D blob 池化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40888514/