TensorFlow to TRT convertion error in windows 10

Hello,
I am trying to convert mine TensorFlow model to TF-TRT but I am getting an error.
ModuleNotFoundError: No module named ‘tensorflow.python.compiler.tensorrt’

Line in code: ‘from tensorflow.python.compiler.tensorrt import trt_convert as trt’

OS: Windows 10
TensorFlow: 2.0.0
CUDA: 10.0
GPU: GTX 1070
TRT Version: 6.0.1.5

I have already used this machine to train models on GPU and it is working fine so CUDA is installed correctly. TRT is installed by the instructions from Nvidia documentations.

Hi,

The TensorRT Python API isn’t supported on Windows (https://docs.nvidia.com/deeplearning/sdk/tensorrt-support-matrix/index.html#platform-matrix), so it isn’t bundled with the Tensorflow pip package for Windows: https://stackoverflow.com/a/58864058.

1 Like

Ok, Thanks!

@NVES_R, thanks for your answer. So then if one has a trained neural network in Windows and wants to run the C++ TensorRT engine in Windows, what are the options?

  1. Using TF-TRT on a Linux machine to generate the TensorRT model and then move the model to Windows to build the engine?
  2. Using the UFF model converter on a Linux machine to generate the TensorRT model and then move the model to Windows to build the engine?
  3. Convert to ONNX using a tool like tf2onnx and importing this ONNX into TensorRT on Windows?
  4. Build the network layer by layer in TensorRT?

Would any of the above work? Is there another method? What is the recommended method?

Answered here: Tensorflow --> TensorRT in Windows

I think option 2, 3 & 4 will work, but I recommend going using tf2onnx and the ONNX parser.