TF-TRT optimzied PB file is too large compared to the first one in the Yolov4 algorithm

Description

I have used Tf-TRT to optimize my tesorflow .pb file. after finishing the process, the final .pb file are too large. All of the related folder and files such as variables and assets file have made correctly.
I have tried to convert a trained yolov4 in Tensorflow2 to TensorRT.
The first saved_model.pb file size is : 12 M.
The final optimized saved_model.pb file size is : 503M.
It is necessary to say I have used the NVIDIA container 19.10 version as a base environment. I really appreciate you to give me a solution .

Environment

TensorRT: [6.0.1]
GPU Type: GeForce RTX 3090
Nvidia Driver Version: 455.23.04
CUDA Version: [NVIDIA CUDA 10.1.243] including [cuBLAS 10.2.1.243]
CUDNN Version: * [NVIDIA cuDNN 7.6.4]
Operating System + Version: [Ubuntu 18.04]
Python Version (if applicable): Python 3.6.8
TensorFlow Version (if applicable): 2.2.0
TensorFlow-gpu Version (if applicable): 2.3.1
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag): nvcr.io/nvidia/tensorrt:19.10-py3

Relevant Files

Hi @maryameslamy69,

As you’re using TF-TRT, we recommend you to try on latest tensorflow ngc container based on your tensorflow version requirement. And please let us know if you still face this issue.
https://ngc.nvidia.com/catalog/containers/nvidia:tensorflow
https://docs.nvidia.com/deeplearning/frameworks/tensorflow-release-notes/index.html

For your reference,
https://docs.nvidia.com/deeplearning/frameworks/tf-trt-user-guide/index.html#usingtftrt

Thank you.

1 Like