首页 > 解决方案 > 对于 TensorRT 版本 5.1.5,模块“tensorrt”没有属性“Logger”

问题描述

Mobilenet v2我在推断OD 模型时尝试使用 TensorRT 。Tensorflow版本是,1.15.0版本Cuda10.0。NVIDIA TensorRT 包是nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.deb. TensorRT版本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'

请指出正确的方向。谢谢你。

标签: pythontensorflownvidiaobject-detectiontensorrt

解决方案


推荐阅读