ImportError: No module named 'tensorrt.parsers'

When trying to run the following Python code:
import tensorrt as trt
from tensorrt.parsers import uffparser
import uff

I receive “ImportError: No module named ‘tensorrt.parsers’”.
Additional details: Python version is 3.5.2. I use TensorRT 5.0RC with CUDA 9.0.
Note that tensorrt is imported successfully and that the TensorRT installation was verified.


we’ve reproduced the issue locally and are reviewing. will keep you updated.


The format has changed with the new python API. The documentation has more details on how this can be done.

You would do something like this with the new API
with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.CaffeParser() as parser:

To continue using the legacy API, you would need to import tensorrt.legacy instead of import tensorrt

NVIDIA Enterprise Support

1 Like

Thanks @NVES, this helped me a lot !