Weights.h5 convert to trtexec engine

Description

How to convert weights.h5 model to weights.engine file.
Kindly give the steps for the same.

Environment

TensorRT Version: 7.0
GPU Type: T4
Nvidia Driver Version: 440
CUDA Version: 10.2
CUDNN Version:
Operating System + Version: 18.04
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

Hi @GalibaSashi,
You can do the conversion with the below mentioned steps
Keras<< ONNX<< TRT
Please check the below link for Keras to Onnx conversion

Thanks!

I tried but can you give additional steps. Because I could not even load the model let alone convert it to onnx.
It is VGG16 model
Thanks

Hi @GalibaSashi
Please follow the steps in the below link for the conversion.

Thanks!

since keras2onnx is no longer maintained, the option put foward is tf2onnx… this implementation seems to be finicky.
Do you know if there are any plans to have trt support direct load of tf or h5?

Hi,
Please refer to the below link for Sample guide.

Refer to the installation steps from the link if in case you are missing on anything

However suggested approach is to use TRT NGC containers to avoid any system dependency related issues.

In order to run python sample, make sure TRT python packages are installed while using NGC container.
/opt/tensorrt/python/python_setup.sh

In case, if you are trying to run custom model, please share your model and script with us, so that we can assist you better.
Thanks!