Can someone give an example of how to use ConvertGraphDefToTensorRT function?
Is this a duplicate issue of topic 1049997?
Or you already fix the installation issue?
While using tensorflow_cc.so, my c++ application not able to locate ConvertGraphDefToTensorRT function.
Which library it will be in?
I have tensorflow working without tensorRT.
I was not sure where to start, so asked question in two different ways.
There are two possible way.
both these paths show how to use python for conversion. I am looking for c/c++ api.
thats why I am looking for ConvertGraphDefToTensorRT
Does it contain example test c++ program to convert tf graph to tensorRT
We have both python and C++ implementation in TensorRT but only python based TensorFlow parser.
You will need to convert the model into .uff file in python interface first.
Please check the link shared above for the detail steps for converting the model.
This conversion using python can happen offline, OR it needs to happen on the fly, everytime we load model for inference?
You only do the conversion once.
After that, you can always create TensorRT with the .uff model directly.
Thanks for updates.
So the steps can be:
- Train a tensorflow model
- Convert the model to uff using method u suggesting.
- Then use new model instead of tensorflow for inference.
Implementation of step3 can be similar to what it was if we use tensorflow model for inference?
Does GPU automatically understands uff model and use tensorRT?
I am using object detection in tensorflow model and using four different output node names.
how does conversion work in that case?
Also, I am working with Jetson Xavier.
Please noticed that if not all the layers are supported by TensorRT, you will need to create a plugin implementation for it.
AFAIK, object detection model usually contains some non-supported layer.
It’s recommended to check our support matrix first:
To answer your question, you can add output as a list.
uff_model = uff.from_tensorflow_frozen_model( frozen_file=net_meta['frozen_graph_filename'], output_nodes=net_meta['output_names1','output_names2'], output_filename=net_meta['uff_filename'], text=False )