wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
7.04k stars 1.78k forks source link

Fixed a bug with inconsistent inference results #1465

Closed stbidtf closed 8 months ago

stbidtf commented 8 months ago

对于同一张图循环推理时,如果检测的目标过多,两个目标的置信度conf可能相等,则根据conf排序时有可能导致排序的不稳定性,在进行一下步的求iou会出现不同的结果。所以要保证tensorrt并行推理结果顺序不同时,排序后的结果一致,不会出现排序的不稳定性

stbidtf commented 8 months ago

我用一张图的循环4次推理结果图,两两对比有什么区别,发现有不同的像素 Snipaste_2024-03-24_12-31-33 通过固定每次conf相等时的检测结果,结果就保持一致了 Snipaste_2024-03-24_12-35-39

wang-xinyu commented 8 months ago

@stbidtf 最近新增了pre-commit检查,参考这个文档在本地运行下pre-commit吧(针对yolov8/src/postprocess.cpp),https://github.com/wang-xinyu/tensorrtx/blob/master/tutorials/contribution.md

stbidtf commented 8 months ago

@stbidtf 最近新增了pre-commit检查,参考这个文档在本地运行下pre-commit吧(针对yolov8/src/postprocess.cpp),https://github.com/wang-xinyu/tensorrtx/blob/master/tutorials/contribution.md

测试通过 image

wang-xinyu commented 8 months ago

@stbidtf postprocess.cpp过了,block.h没过,可以把block.h恢复下