Assertion failed: transformationMode ""TensorRT only supports asymmetric tranformation mode for nearest neighbor resizes when scales are provided!"

Continuing the discussion from Step-wise procedure to deploy a custom tensorflow 2.4 object detection model in deepstream 5.1:

After following the script in Step-wise procedure to deploy a custom tensorflow 2.4 object detection model in deepstream 5.1 - #14 by AastaLLL I get another error.

[10/04/2021-19:58:27] [E] [TRT] /home/DV_RA/torch_to_trt/onnx-tensorrt/ModelImporter.cpp:685: While parsing node number 244 [Resize -> "1019"]:
[10/04/2021-19:58:27] [E] [TRT] /home/DV_RA/torch_to_trt/onnx-tensorrt/ModelImporter.cpp:686: --- Begin node ---
[10/04/2021-19:58:27] [E] [TRT] /home/DV_RA/torch_to_trt/onnx-tensorrt/ModelImporter.cpp:687: input: "1014"
input: "1018"
input: "1394"
output: "1019"
name: "Resize_245"
op_type: "Resize"
attribute {
  name: "coordinate_transformation_mode"
  s: "align_corners"
  type: STRING
}
attribute {
  name: "cubic_coeff_a"
  f: -0.75
  type: FLOAT
}
attribute {
  name: "mode"
  s: "nearest"
  type: STRING
}
attribute {
  name: "nearest_mode"
  s: "floor"
  type: STRING
}

[10/04/2021-19:58:27] [E] [TRT] /home/DV_RA/torch_to_trt/onnx-tensorrt/ModelImporter.cpp:688: --- End node ---
[10/04/2021-19:58:27] [E] [TRT] /home/DV_RA/torch_to_trt/onnx-tensorrt/ModelImporter.cpp:691: ERROR: /home/DV_RA/torch_to_trt/onnx-tensorrt/builtin_op_importers.cpp:3056 In function importResize:
[8] Assertion failed: transformationMode == "asymmetric" && "TensorRT only supports asymmetric tranformation mode for nearest neighbor resizes when scales are provided!"
[10/04/2021-19:58:27] [E] Failed to parse onnx file
[10/04/2021-19:58:28] [E] Parsing model failed
[10/04/2021-19:58:28] [E] Engine creation failed
[10/04/2021-19:58:28] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec # trtexec --onnx=/media/31A079936F39FBF9/romil/test_models/local_models_v2/midas/midas384_b4_folded_nearest_220921.onnx --fp16

On checking the onnx with Netron, I see that the scales are present.

Please suggest how to solve this.

• Hardware Platform (Jetson / GPU) Jetson NX
• JetPack Version (valid for Jetson only) 4.4.1
• TensorRT Version 7.1.3
• Issue Type( questions, new requirements, bug) questions
• How to reproduce the issue ? run: trtexec --onnx=model.onnx --fp16
model.onnx

Hi @romilaggarwal611,

With latest TensorRT version 8.2 EA, we are unable to reproduce the issue. We recommend you to please try on the latest TensorRT version.

Thank you.

@spolisetty thanks for the response! I was able to build the engine with TensorRT 8.
But if possible can you suggest how I could make this engine with the older version of TensorRT ie 7.1.3 since my whole application is built using that. Thanks again!

Hi,

Currently cross-compatibility of versions is not possible in TensorRT. You may need to use latest version.

Thank you.

Sorry for not being clear. I meant I wanted to build an engine for this onnx using TensorRT 7.1.3 itself. I was able to build it using TensorRT 8.

Hi,

Sorry for not being clear.
There are some changes and bug fixes in Resize layer from TRT 7.2 onwards. Using 7.1.3 you may not be able to build the engine.

Just for a note, in case you’ve version dependency due to Jetpack, you can try upgrading Jetpack version to the latest which includes TRT 8.0.1 version.

Thank you.

1 Like