我在导入 Logger() 和 Builder() 时遇到错误
我在 Jetson AGX Xavier 上。
我也尝试过python shell。
import tensorflow.contrib.tensorrt as trt
TRT_LOGGER = trt.Logger(trt.Logger.INFO)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow.contrib.tensorrt' has no attribute 'Logger'
我也不能导入 trt.Builder() 。
Python 版本是 3.6.7
“dpkg -l | grep nvinfer”的输出给出了 Tensor RT 版本:
ii libnvinfer-dev 5.0.6-1+cuda10.0 arm64 TensorRT development libraries and headers
ii libnvinfer-samples 5.0.6-1+cuda10.0 all TensorRT samples and documentation
ii libnvinfer5 5.0.6-1+cuda10.0 arm64 TensorRT runtime libraries
ii python-libnvinfer 5.0.6-1+cuda10.0 arm64 Python bindings for TensorRT
ii python-libnvinfer-dev 5.0.6-1+cuda10.0 arm64 Python development package for TensorRT
ii python3-libnvinfer 5.0.6-1+cuda10.0 arm64 Python 3 bindings for TensorRT
ii python3-libnvinfer-dev 5.0.6-1+cuda10.0 arm64 Python 3 development package for TensorRT