I found that we can optimize the Tensorflow model in several ways. Someone asked the same question in github, but no one answered. I think maybe i can get the answer here.
1- Using TF-TRT This API developer by tensorflow and integreted TensoRT to Tensorflow and this API called as :
from tensorflow.python.compiler.tensorrt import trt_convert as trt
This API can be applied to any tensorflow models (new and old version models) without any converting error, because If this API don’t support any new layers, don’t consider these layers for TensorRT engines and these layers remain for Tensorflow engine and run on Tensorflow. right?
2- Using TensorRT, This API by developed by NVIDA and is independent of Tenorflow library (Not integrated to Tensorflow), and this API called as:
import tensorrt as trt
If we want to use this api, first, we must converting the tensorflow graph to UFF using uff-convertor and then parse the UFF graph to this API.
In this case, If the Tensorflow graph have unsupported layers we must use plugin or custom code for these layers, right?