I convert a tensorflow model to UFF. Howerver, the output shape is wrong.
The input shape is (3, 225, 300) (parser.register_input(“image_tensor”, (3, 225, 300), 0)), after a convolution(kernel=[3, 3], stride=2, depth=32, padding=same),the shape should be (1, 113, 150, 32), but I get the output shape (537600 = 1* 11215032)
The parser information is as below:
[TensorRT] INFO: UFFParser: parsing FeatureExtractor/MobilenetV1/Conv2d_0/weights
[TensorRT] INFO: UFFParser: parsing FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/Conv2D
[TensorRT] INFO: UFFParser: Convolution: add Padding Layer to support asymmetric padding
[TensorRT] INFO: UFFParser: Convolution: Left: 1
[TensorRT] INFO: UFFParser: Convolution: Right: 1
[TensorRT] INFO: UFFParser: Convolution: Top: 0
[TensorRT] INFO: UFFParser: Convolution: Bottom: 1
It seems that when the width of the input is not equal to the height of the input, the output is wrong.
TensorRT use the full type convolution(padding=same): H: f(x, k, p, s) = ceil((x+2p-k)/s)+1 = ceil((225+20-3)/2)+1 = 112. W: f(x, k, p, s) = ceil((x+2p-k)/s)+1 = ceil((300+20-3)/2)+1 = 150.
The output of TensorRT follows this rule correctly and information can be found at:
/usr/share/doc/tensorrt/html/classnvinfer1_1_1_i_output_dimensions_formula.html
Could you share how you get the output dimension of (1, 113, 150, 32)?
Thanks.