pytorch转caffe中maxpool一定要注意

caffe使用BVLC版本caffe.修改编译参考:https://blog.csdn.net/qq_35975447/article/details/107507434

pytorch转caffe中maxpool一定要注意,不然成功转换了还是会出错.下面给出了pytorch与caffe中maxpool层的转换的对应关系.为了自己以后不要再被这个问题坑吧.

fast-reid中怎么转caffe成功且正确.

pytorch layer
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)


caffe layer:
layer {
  name: "max_pool1"
  type: "Pooling"
  bottom: "relu_blob1"
  top: "max_pool_blob1"
  pooling_param {
    pool: MAX
    kernel_size: 3
    stride: 2
    pad: 0 # 1
    # ceil_mode: false
  }
}

 

你可能感兴趣的:(#,Pytorch,#,Caffe,深度学习框架,caffe,pytorch,maxpool)