# Mxnet2Caffe:The output\_shape from convolution is different

**URL:** <https://forums.developer.nvidia.com/t/mxnet2caffe-the-output-shape-from-convolution-is-different/68325>\
**Category:** TensorRT\
**Created:** [December 10, 2018, 6:40am UTC](https://forums.developer.nvidia.com/t/mxnet2caffe-the-output-shape-from-convolution-is-different/68325 "2018-12-10T06:40:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![1540970049](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@1540970049](https://forums.developer.nvidia.com/u/1540970049)\
**Post date:** [December 10, 2018, 6:40am UTC](https://forums.developer.nvidia.com/t/mxnet2caffe-the-output-shape-from-convolution-is-different/68325/1 "2018-12-10T06:40:49Z")

</div>

I try to converte mxnet\_model to caffe\_model,and use tensorrt to parse caffe\_model,but have some problem now.

In mxnet,the output shape from pooling\_layer or conv\_layer is: floor((height+2_padding[0]-dilation[0]_(kernel\_size[0]-1)-1)/stride[0])+1 , but In caffe ，it’s ceil(…)  
;  
such as,The input shape is （108_108）,convolution is(k:3,p:1,s:2）,so the the output\_shape from mxnet is floor( (108+2_1-3)/2 +1 )=floor(54.5) = 54, the output\_shape from caffe is 55,  
if I set pad=0 manually in caffe model,the output\_shape is same with mxnet but the result is not same,because it changed the field of perception.
