tensorflow/tensorrt

No module named 'tensorflow.python.compiler.tensorrt'

maurera opened this issue · 2 comments

Platform: Tensorflow 2.0. Python 3.7. Testing on local windows machine with no GPU before deploying to AWS EC2 machine with GPU.

Apologies if this is a very simple question.

I'm trying to use TensorRT for the first time in order to speed up model predict time. The nvidia documentation: 2.2.4. TF-TRT 2.0 Workflow With A SavedModel says to start by running:

import tensorflow as tf
from tensorflow.python.compiler.tensorrt import trt_convert as trt

When I do this, I get the error: ModuleNotFoundError: No module named 'tensorflow.python.compiler.tensorrt'. Is tensorrt still included with tensorflow? Do I need to install it separately?

Issue solved by running on GPU machine. tensorflow.python.compiler.tensorrt appears to be included in tensorflow-gpu, but not (standard cpu-only) tensorflow