Question about unnamed padding layer when parsing a UFF file.

Hello,

I convert an TensorFlow inception v2 graph into a UFF file. Then I use IUffParser::parse() to parse the UFF file into an nvinfer1::INetworkDefinition object. When I traverse the network, I noticed that there is an unnamed padding layer before every pooling or convolution layer with kernel size 3 and stride 2. However, I don’t see such unnamed padding layer added before convolution layer with kernel size 3 but stride 1. Is padding for stride 1 handled differently from larger stride so that there isn’t an explicit padding layer?

Jia

Hi,

It should be fine.
TensorRT may add some auxiliary layers when converting models.

Thanks.

My question is actually when TensorRT will insert auxiliary padding layer, and when it just uses the padding attribute in a convolution or pooling layer. I am curious because I think there may be a bug in how TensorRT computes padding which results in different padding when compared with original TensorFlow graph.

Hi,

You can find information in the uff-parser log when converting the TensorFlow model to UFF.

Ex

[TensorRT] INFO: UFFParser: parsing Conv_1/weights
[TensorRT] INFO: UFFParser: parsing Conv_1/Conv2D
[TensorRT] INFO: UFFParser: Convolution: add Padding Layer to support asymmetric padding
[TensorRT] INFO: UFFParser: Convolution: Left: 0
[TensorRT] INFO: UFFParser: Convolution: Right: 1

Thanks.