TensorRT:AttributeError: 'module' object has no attribute 'Logger'

简介: TensorRT:AttributeError: 'module' object has no attribute 'Logger'

TensorRT版本与代码写法不对.


具体写法:


   

# using trt 4.0
        G_LOGGER = trt.infer.ConsoleLogger(trt.infer.LogSeverity.INFO)
        trt_engine = trt.utils.load_engine(G_LOGGER, engine_path)
        """
        ## using trt 5.0
        G_LOGGER = trt.Logger(trt.Logger.WARNING)
        with open(engine_path, "rb") as f, trt.Runtime(G_LOGGER) as runtime:
            trt_engine = runtime.deserialize_cuda_engine(f.read())
        """
        self.engine = Engine(trt_engine)
目录
相关文章
|
2月前
|
计算机视觉 Python
解决 NoneType‘ object has no attribute ‘astype’ 问题
解决 NoneType‘ object has no attribute ‘astype’ 问题
30 0
|
6月前
|
存储 JSON 数据格式
数据集加载时报错'dict' object has no attribute 'requests‘
数据集加载时报错'dict' object has no attribute 'requests‘
115 5
|
4月前
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
381 0
|
7月前
|
Python Windows
xlrd库报错【AttributeError: ‘ElementTree‘ object has no attribute ‘getiterator‘】
xlrd库报错【AttributeError: ‘ElementTree‘ object has no attribute ‘getiterator‘】
120 0
|
4月前
AttributeError ‘NoneType‘ object has no attribute ‘to_capabilities‘
AttributeError ‘NoneType‘ object has no attribute ‘to_capabilities‘
93 0
|
5月前
|
数据采集
运行爬虫时报错AttributeError—— 'str' object has no attribute 'capabilities'
运行爬虫时报错AttributeError—— 'str' object has no attribute 'capabilities'
261 0
|
5月前
'WebDriver' object has no attribute 'find_element_by_tag_name'
'WebDriver' object has no attribute 'find_element_by_tag_name'
120 0
|
9月前
yolov7—tensorrt报错AttributeError: ‘NoneType‘ object has no attribute ‘execute_v2‘已解决。
yolov7—tensorrt报错AttributeError: ‘NoneType‘ object has no attribute ‘execute_v2‘已解决。
91 0
yolov7—tensorrt报错AttributeError: ‘NoneType‘ object has no attribute ‘execute_v2‘已解决。
|
6月前
|
Java
java判断Object对象是否为空demo
java判断Object对象是否为空demo
|
23天前
|
JavaScript
js 字符串String转对象Object
该代码示例展示了如何将一个以逗号分隔的字符串(`'1.2,2,3,4,5'`)转换为对象数组。通过使用`split(',')`分割字符串并`map(parseFloat)`处理每个元素,将字符串转换成浮点数数组,最终得到一个对象数组,其类型为`object`。