transfer tf.multiply to tensorrt op

I got the following error when I load my uff model:

“[E] [TRT] Mul: elementwise inputs must have same dimensions or follow broadcast rules (input dimensions were [22,40,512] and [512,1,1])
[E] [TRT] UffParser: Parser error: MarkOutput_0: Order size is not matching the number dimensions of TensorRT”

However, I check the inputs for mul node, shape of first input is [22, 40, 512], and shape of second input is [1, 1, 512], I want to know why tensorRT transfer second input into the shape of [512, 1, 1], and how to fix this problem? thank you.

Hi, have you solve this problem? thanks

+1

I have same issue using TensorRT 6.0.1.8 when trying to convert my UFF model to TensorRT engine.

[TensorRT] ERROR: block1a_se_excite_1/mul: elementwise inputs must have same dimensions or follow broadcast rules (input dimensions were [120,120,32] and [32,1,1])
python3: ../builder/cudnnBuilderUtils.cpp:577: void nvinfer1::cudnn::updatePaddingAccordingToPaddingMode(nvinfer1::PaddingMode, nvinfer1::Dims&, nvinfer1::Dims&, nvinfer1::Dims, nvinfer1::Dims, nvinfer1::Dims, nvinfer1::Dims, bool): Assertion `inputDims.nbDims >= nbSpatialDims' failed.

I double checked my network and the shape of the input got reversed by TensorRT.

As you can see, the original shape was [1, 1, 32].

Any solution?