导出代码非常简单:
import tensorrt_bindings.tensorrt
from ultralytics import YOLO
import tensorrt_bindings
# Load a YOLOv8n PyTorch model
model = YOLO('训练好的.pt文件的路径')
# Export the model
model.export(format='engine')
然后就报错:AttributeError: 'tensorrt_bindings.tensorrt.IBuilderConfig' object has no attribute 'max_workspace_size'

定位到 \ultralytics\engine\exporter.py第597行左右,有一行:
config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, workspace << 30) # fix TRT 8.4 deprecation notice
查阅文档TensorRT文档发现根本就没这个变量了(

最低0.47元/天 解锁文章
922

被折叠的 条评论
为什么被折叠?



