Error in converting a tensorflow model to FF and builds the TensorRT engine

Hi,

I created an SSD-Mobilenet Object Detection Model using PyTorch and the Open Images dataset.after that it was converted into ONNX and then into PB, when trying to convert to FF gives this error.
I also tried it with another model already trained in tensorflow and it gives the same error, the example models I can run normal.

I’m using the tensorrt_demos library

specification:
Jetson nano
JetPack 4.5.1
tensorflow 1.15.5
numpy 1.16.1
uff 0.6.9
graphsurgeon 0.4.5
protobuf 3.17.3

Hi,
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

check_model.py

import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
onnx.checker.check_model(model).
2) Try running your model with trtexec command.
https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/trtexec
In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging
Thanks!

well, so far I haven’t been able to convert the PB model into FF and later to bin tensorRT enginem, but instead I took the ONNX model and managed to convert it into .engine tensor RT.

I wanted the model in bin because there are several examples of code in python, would you have any example of python code using the .engine model with the webcam?

files:
build_engine.py (10.7 KB)
ssd_mobilenet.pb (25.9 MB)
ssd-mobilenet.onnx (25.3 MB)

if you can find the cause of the error in converting the PB model into FF or make available python codes using model.engine I will be grateful

Hi @matheuscaltran,

Hope following examples will be helpful to you. And could you please give more details/steps you are following for converting model to FF.

https://github.com/pskiran1/TensorRT-support-for-Tensorflow-2-Object-Detection-Models/blob/main/infer.py
https://github.com/pskiran1/TensorRT-support-for-Tensorflow-2-Object-Detection-Models

Thank you.

I’m using demo #3 SSD, adding the command to my model to build_engine.py and trying to run that error

Hi,

Are you still facing this issue.

yes, give up on pytorch now i’m training a straight with tensorflow

Hope above shared link will be helpful to you.

Thank you.