This repo documnet how to convert Tensorflow / Keras model to TRT engine using ONNX.
Note this quote from the official TensorRT Release Notes:
Deprecation of Caffe Parser and UFF Parser - We are deprecating Caffe Parser and UFF Parser in TensorRT 7. They will be tested and functional in the next major release of TensorRT 8, but we plan to remove the support in the subsequent major release. Plan to migrate your workflow to use tf2onnx, keras2onnx or TensorFlow-TensorRT (TF-TRT) for deployment.
In this repository, we will use tf2onnx to convert Keras model to TRT engine.
ONNX Workflow - image source.
- Convert the TensorFlow/Keras model to a .pb file.
- Convert the .pb file to the ONNX format.
- Create a TensorRT engine.
- Run inference from the TensorRT engine.
The steps are documented in this Jupyter notebook.
Protobuf compiler not found while installing tf2onnx tool
Solution
sudo apt-get install libprotobuf-dev protobuf-compiler