FeiYull / TensorRT-Alpha

🔥🔥🔥TensorRT for YOLOv8、YOLOv8-Pose、YOLOv8-Seg、YOLOv8-Cls、YOLOv7、YOLOv6、YOLOv5、YOLONAS......🚀🚀🚀CUDA IS ALL YOU NEED.🍎🍎🍎
GNU General Public License v2.0
1.25k stars 195 forks source link

yoloV8-seg error #86

Open niuyuanye opened 4 months ago

niuyuanye commented 4 months ago

在使用yolov8-seg时,转换官方模型都正常,在转换自己训练的模型(只有1类,python测试.pt都正常)时,程序不报错,但显示的分割结果错误

FeiYull commented 4 months ago

@niuyuanye 要修改类别数,比如: https://github.com/FeiYull/TensorRT-Alpha/blob/87fdb72056682835ab06e417f7d51f483e197ebf/yolov8-seg/yolov8_seg.cpp#L8

// 网络输出中,det输出特征图宽度为:116,// 116=4+80+32,32为seg部分特征,经过NMS之后,输出为:N*38,其中38=4 + 2 + 32

还有外部num_classes也要改

niuyuanye commented 4 months ago

问题解决了

niuyuanye commented 4 months ago

Eigen::Map img_ojbseg(ptr + 7, m_output_seg_h, 1); //使用eigen的map功能进行内存映射 [25,1] m_mask_eigen160 = imgseg img_ojbseg;//矩阵相乘 [160160,25][25,1]=[160160,1] 分割后处理之一部分,耗时比较多,有什么优化的方法么

FeiYull commented 4 months ago

@niuyuanye 看你的平台,也可以试下opencv的矩阵乘法;还可尝试把最后处理全部放进cuda计算

niuyuanye commented 4 months ago

@FeiYull 我是在orin下测试,使用opencv相乘效率提高很多,是因为orin下的Eigen 没有相应的底层不支持相应的加速么,你这边有相应的测试过么

FeiYull commented 4 months ago

@niuyuanye 感谢反馈,在pc上,使用intel处理器:i9-13900,实测eigen比opencv快。

niuyuanye commented 3 months ago

@FeiYull 你好,使用TensorRT-7.1.3版本转换onnx-trt你测试过可以正常使用么,我这边测试有报错:ERROR: onnx2trt_utils.cpp:188 In function convertAxis: [8] Assertion failed: axis >= 0 && axis < nbDims 看网上说,需要升级TensorRT,请问有其他解决办法么?