TesorRT10模型转换时的错误记录并解决

由于为个人安装的是TensorRT10,有些参数可能就不用了,在模型转换的时候会出现错误(本文章长期更新)

特别注意onnxruntime_gpu的安装,他是与CUDA和CUDANN版本进行绑定的
安装时候参考网址

错误1

YOLOv8模型转换的时候,出现了
attributeerror: 'tensorrt.tensorrt.builder' object has no attribute 'max_workspace_size'

这个是由于TensoRT8.4版本之后,取消了这个max_workspace_size,这个可以这样修改

复制代码
1注销掉
        #config.max_workspace_size = self.args.workspace * 1 << 30
2、紧接其后,添加这个
        config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, 1<<30)  # fix TRT 8.4 deprecation notice
3、write file的修改为这个
         with builder.build_serialized_network(network, config) as engine, open(f, 'wb') as t:
 4、写文件修改为:
             #t.write(engine.serialize())
            t.write(engine)
相关推荐
椒颜皮皮虾10 天前
TensorRtSharp:在 C# 世界中释放 GPU 推理的极致性能
c#·tensorrt
给算法爸爸上香17 天前
yolo tensorrt视频流检测软解码和硬解码
yolo·ffmpeg·视频编解码·tensorrt·nvcodec
Tipriest_20 天前
TensorRT介绍与示例代码学习
tensorrt
Arnold-FY-Chen21 天前
模型部分量化后用tensorrt转换engine时遇到的问题
tensorrt·mismatched type·constant tensor·setprecision
破烂pan23 天前
TensorRT-LLM部署Qwen3-14B
llm·tensorrt·qwen3-14b
雪天鱼2 个月前
TensorRT 10.14.1 初体验:介绍、安装与Demo尝试
tensorrt·ai模型推理·深度学习环境搭建
plmm烟酒僧2 个月前
TensorRT 推理 YOLO Demo 分享 (Python)
开发语言·python·yolo·tensorrt·runtime·推理
<-->2 个月前
TensorRT-LLM 核心技术深度分析报告
tensorflow·tensorrt
_Stellar2 个月前
【TensorRT】Could not load library libcudnn_cnn_infer.so.8
tensorrt
zhy295633 个月前
【DNN】基础环境搭建
人工智能·tensorrt·cuda·开发环境·cudnn