[TensorRT 7.0.0] Assertion failed: convertOnnxWeights(initializer, &weights, ctx)

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) V100-SXM2
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version 7.0.0
• NVIDIA GPU Driver Version (valid for GPU only) 510.47.03
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
I am trying to convert http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v2_coco_2018_03_29.tar.gz to tensorRT. Following the path tensorflow → onnx → tensorRT
I ran this command
./trtexec --onnx=/home/sahilwa/workplace/onnx-models/ssd_mobilenet_v2_coco_2018_03_115.onnx --explicitBatch --workspace=4096 --minTiming=10 --fp16 --saveEngine=ssd_mobilenet_v2_coco_2018_03_115.trt --verbose

But I get this error
[8] Assertion failed: convertOnnxWeights(initializer, &weights, ctx)

I have followed tensort7 load onnx resize ops error · Issue #386 · NVIDIA/TensorRT · GitHub but doesn’t work
ssd_mobilenet_v2_coco_2018_03_29.onnx (66.1 MB)

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Moving this issue to TensorRT forum.

Request you to share the ONNX model and the script if not shared already so that we can assist you better.
Alongside you can try few things:

  1. validating your model with the below snippet


import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
2) Try running your model with trtexec command.

In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging

I have share the model in this post https://forums.developer.nvidia.com/uploads/short-url/ijiCtpgMzgDCM3EXHhiF00u6HIo.onnx. Please have a look. I have already performed all the above tasks as you have mentioned above


We identified that you’re using an unsupported data type UINT8. Currently, UINT8 data type is not supported by the TensorRT.

[04/19/2022-05:59:49] [V] [TRT] Plugin creator already registered - ::InstanceNormalization_TRT version 2
Unsupported ONNX data type: UINT8 (2)
[04/19/2022-05:59:49] [E] [TRT] ModelImporter.cpp:754: ERROR: inputs:231 In function importInput:
[8] Assertion failed: convertDtype(onnxDtype.elem_type(), &trtDtype) && “Failed to convert ONNX date type to TensorRT data type.”
[04/19/2022-05:59:49] [E] Failed to parse onnx file
[04/19/2022-05:59:49] [I] Finish parsing network model
[04/19/2022-05:59:49] [E] Parsing model failed
[04/19/2022-05:59:49] [E] Failed to create engine from model.
[04/19/2022-05:59:49] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec [TensorRT v8400] # /usr/src/tensorrt/bin/trtexec --onnx=model.onnx --verbose --workspace=10000

Also, looks like you’re using an old version of the TensorRT. We recommend you to please use the latest TensorRT version.

Thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.