UFF parser errors

TensorRT 4.0 produces the following error when I try to create TensorRT engine from a UFF model:

[TensorRT] ERROR: conv1_1/Conv2D: kernel weights has count 1152 but 282816 was expected
[TensorRT] ERROR: UFFParser: Parser error: conv1_1/BiasAdd: The input to the Scale Layer is required to have a minimum of 3 dimensions.

I have 2 image inputs of size 435x491, my engine creation:

parser.register_input("Placeholder", (1,435,491), 0)
parser.register_input("Placeholder_1", (1,435,491), 0)
parser.register_output("outconv/Relu")
engine = trt.utils.uff_to_trt_engine(G_LOGGER, uff_model, parser, 1, 1 << 20)

What am I doing wrong?

Hi,

There is an incorrect setting in your implementation on register_input.
The third argument targets for input buffer ID and it should be 0 and 1 correspondingly.

parser.register_input("Placeholder", (1,435,491), 0)
parser.register_input("Placeholder_1", (1,435,491), <b>1</b>)

You can find more information in our document:
https://docs.nvidia.com/deeplearning/sdk/tensorrt-api/python_api/pkg_ref/parsers.html?highlight=parser#tensorrt.parsers.uffparser.UffParser.register_input

Thanks.

Hello AastaLLL,

Unfortunately, changing second input buffer ID to 1 did not help and I am still getting the same error.

Here is the output from INFO log:

INFO: UFFParser: parsing Placeholder
INFO: UFFParser: parsing Placeholder_1
INFO: UFFParser: parsing concat
INFO: UFFParser: parsing conv1_1/weights
INFO: UFFParser: parsing conv1_1/Conv2D
INFO: UFFParser: parsing conv1_1/bias
INFO: UFFParser: parsing conv1_1/BiasAdd
ERROR: conv1_1/Conv2D: kernel weights has count 1152 but 282816 was expected
ERROR: UFFParser: Parser error: conv1_1/BiasAdd: The input to the Scale Layer is required to have a minimum of 3 dimensions.
ERROR: sample_uff_test: Fail to parse
ERROR: sample_uff_test: Model load failed

Do you have any other suggestion about what I can look at to get this network to work?

Hi,

Based on your log:

ERROR: UFFParser: Parser error: conv1_1/BiasAdd: The input to the Scale Layer is required to have a minimum of 3 dimensions.

This error may come from previous Scale layer.
Could you share your model architecture with us?

Thanks.

Forum does not let me attach my network for some reason (maybe size limitations?), I sent you a link to my model via a private message.

Thank you

Hi,

We have received your model and is checking internally.
Will update information with you later.

Thanks.

Hi,

Sorry for the late reply.

We have checked the model you shared.
It looks like your model uses NHWC format, could you re-range it into NCHW and try it again?

---  (<tf.Tensor 'Placeholder_1:0' shape=(1, 435, 491, 1) dtype=float32>,)
---  (<tf.Tensor 'Placeholder:0' shape=(1, 435, 491, 1) dtype=float32>,)
+++  (<tf.Tensor 'Placeholder_1:0' shape=(1, 1, 435, 491) dtype=float32>,)
+++  (<tf.Tensor 'Placeholder:0' shape=(1, 1, 435, 491) dtype=float32>,)

Thanks.

I have a different model that uses NHWC format and that did not cause any parsing issues. Doesn’t that indicate that TensorRT should work fine with NHWC format?

Hi All,

I am facing similar issue with SqueezeNet Architecture (an ImageNet pretrained model) on Tensorflow. Again I am also using NHWC format

Regards,

Pallab

Hello AastaLLL.

Thank you for all your help so far. I really appreciate you trying to help me get my network working.

After converting the model to NCHW format, I get this error:

ERROR: UFFParser: Parser error: deconv1/conv2d_transpose: Output shape of UFF ConvTranspose is wrong

For conv2d_transpose I did set “data_format=‘NCHW’”, both input tensor and output tensor have NCWH format.

Full INFO output:

INFO: UFFParser: parsing Placeholder
INFO: UFFParser: parsing Placeholder_1
INFO: UFFParser: parsing concat
INFO: UFFParser: parsing conv1_1/weights
INFO: UFFParser: parsing conv1_1/Conv2D
INFO: UFFParser: parsing conv1_1/bias
INFO: UFFParser: parsing conv1_1/BiasAdd
INFO: UFFParser: parsing conv1_1/Relu
INFO: UFFParser: parsing conv1_2/weights
INFO: UFFParser: parsing conv1_2/Conv2D
INFO: UFFParser: parsing conv1_2/bias
INFO: UFFParser: parsing conv1_2/BiasAdd
INFO: UFFParser: parsing conv1_2/Relu
INFO: UFFParser: parsing pool1
INFO: UFFParser: Pooling: add Padding Layer to support asymmetric padding
INFO: UFFParser: Pooling: Left: 0
INFO: UFFParser: Pooling: Right: 0
INFO: UFFParser: Pooling: Top: 0
INFO: UFFParser: Pooling: Bottom: 1
INFO: UFFParser: parsing conv2_1/weights
INFO: UFFParser: parsing conv2_1/Conv2D
INFO: UFFParser: parsing conv2_1/bias
INFO: UFFParser: parsing conv2_1/BiasAdd
INFO: UFFParser: parsing conv2_1/Relu
INFO: UFFParser: parsing conv2_2/weights
INFO: UFFParser: parsing conv2_2/Conv2D
INFO: UFFParser: parsing conv2_2/bias
INFO: UFFParser: parsing conv2_2/BiasAdd
INFO: UFFParser: parsing conv2_2/Relu
INFO: UFFParser: parsing pool2
INFO: UFFParser: Pooling: add Padding Layer to support asymmetric padding
INFO: UFFParser: Pooling: Left: 0
INFO: UFFParser: Pooling: Right: 0
INFO: UFFParser: Pooling: Top: 0
INFO: UFFParser: Pooling: Bottom: 1
INFO: UFFParser: parsing conv3_1/weights
INFO: UFFParser: parsing conv3_1/Conv2D
INFO: UFFParser: parsing conv3_1/bias
INFO: UFFParser: parsing conv3_1/BiasAdd
INFO: UFFParser: parsing conv3_1/Relu
INFO: UFFParser: parsing conv3_2/weights
INFO: UFFParser: parsing conv3_2/Conv2D
INFO: UFFParser: parsing conv3_2/bias
INFO: UFFParser: parsing conv3_2/BiasAdd
INFO: UFFParser: parsing conv3_2/Relu
INFO: UFFParser: parsing pool3
INFO: UFFParser: parsing conv4_1/weights
INFO: UFFParser: parsing conv4_1/Conv2D
INFO: UFFParser: parsing conv4_1/bias
INFO: UFFParser: parsing conv4_1/BiasAdd
INFO: UFFParser: parsing conv4_1/Relu
INFO: UFFParser: parsing conv4_2/weights
INFO: UFFParser: parsing conv4_2/Conv2D
INFO: UFFParser: parsing conv4_2/bias
INFO: UFFParser: parsing conv4_2/BiasAdd
INFO: UFFParser: parsing conv4_2/Relu
INFO: UFFParser: parsing pool4
INFO: UFFParser: parsing conv5_1/weights
INFO: UFFParser: parsing conv5_1/Conv2D
INFO: UFFParser: parsing conv5_1/bias
INFO: UFFParser: parsing conv5_1/BiasAdd
INFO: UFFParser: parsing conv5_1/Relu
INFO: UFFParser: parsing conv5_2/weights
INFO: UFFParser: parsing conv5_2/Conv2D
INFO: UFFParser: parsing conv5_2/bias
INFO: UFFParser: parsing conv5_2/BiasAdd
INFO: UFFParser: parsing conv5_2/Relu
INFO: UFFParser: parsing deconv1/weights
INFO: UFFParser: parsing Shape
INFO: UFFParser: parsing deconv1/strided_slice_3/stack
INFO: UFFParser: parsing deconv1/strided_slice_3/stack_1
INFO: UFFParser: parsing deconv1/strided_slice_3/stack_2
INFO: UFFParser: parsing deconv1/strided_slice_3
INFO: UFFParser: parsing deconv1/conv2d_transpose/output_shape/1
INFO: UFFParser: parsing deconv1/strided_slice_4/stack
INFO: UFFParser: parsing deconv1/strided_slice_4/stack_1
INFO: UFFParser: parsing deconv1/strided_slice_4/stack_2
INFO: UFFParser: parsing deconv1/strided_slice_4
INFO: UFFParser: parsing deconv1/strided_slice_5/stack
INFO: UFFParser: parsing deconv1/strided_slice_5/stack_1
INFO: UFFParser: parsing deconv1/strided_slice_5/stack_2
INFO: UFFParser: parsing deconv1/strided_slice_5
INFO: UFFParser: parsing deconv1/conv2d_transpose/output_shape
INFO: UFFParser: parsing deconv1/conv2d_transpose
ERROR: UFFParser: Parser error: deconv1/conv2d_transpose: Output shape of UFF ConvTranspose is wrong

Hi,

We thinks some of your layer combination may mess-up TensorRT in axis.

Could you share the updated model with us?
Or could you help to apply this experiment for us?

parser.register_output("conv5_2/Relu")
...
print engine.get_binding_dimensions(2).to_DimsCHW().H()
print engine.get_binding_dimensions(2).to_DimsCHW().W()
print engine.get_binding_dimensions(2).to_DimsCHW().C()

Thanks.

Hello,

My script fails at “uff_to_trt_engine” engine creation, so I cannot access the engine instance. I sent you the model via a private message.

Thank you.

Hi,

Sorry for the late reply. We are going to do further investigation on this.
Have you solved this issue?

Thanks.

Hello AastaLLL,

Thank you for your help. Unfortunately, I cannot get past “Output shape of UFF ConvTranspose is wrong” error. Please let me know if there is anything else I can try to get the network working.

Thank you.

Hello AastaLLL,

Do you have any updates on the issue?

Hi,

Sorry that we are still working on this issue.
Will update information with your later.

Thanks for your patience.

hi, AastaLLL,

Do you have any updates ? I meet a similar issue.

Hi,

We are still working on this.
Will update information with you later.

Thanks.

Hi, AastaLLL

Do you have any update? I meet a similar issue