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.
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