对于tensorrt版本5.1.5,模块“tensorrt”没有属性“Logger”

2024-04-25 20:35:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我在推断Mobilenet v2OD模型时试图使用TensorRT。Tensorflow版本是1.15.0Cuda版本是10.0。NVIDIA TensorRT包是nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.debTensorRT版本是5.1.5.0-1+cuda10.0。我已经尝试了所有的github,NVIDIA和stackoverflow资源。你知道吗

import tensorrt as trt
uff_model_path = "ssd_mobilenet_v2_coco_2018_03_29/frozen_inference_graph.uff"
engine_path = "ssd_mobilenet_v2_coco_2018_03_29/ssd_mobilenet_v2_bs_1.engine"
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
trt.init_libnvinfer_plugins(TRT_LOGGER, '')

错误日志:

AttributeError                            Traceback (most recent call last)
<ipython-input-6-651d430e77b0> in <module>()
      1 uff_model_path = "ssd_mobilenet_v2_coco_2018_03_29/frozen_inference_graph.uff"
      2 engine_path = "ssd_mobilenet_v2_coco_2018_03_29/ssd_mobilenet_v2_bs_1.engine"
----> 3 TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
      4 trt.init_libnvinfer_plugins(TRT_LOGGER, '')
      5 

AttributeError: module 'tensorrt' has no attribute 'Logger'

请给我指一下正确的方向。非常感谢。你知道吗


Tags: path版本loggerenginev2nvidiassdcoco