yolov5 Tensorrtx int 8 量化问题记录

1.需要准备 校准数据集 ,从训练集中随机选择 500+以上的数据,不带标注;

2.需要修改 yolov5.cpp 中 int 8量化时的校准数据集的文件路径,与 准备的数据集文件路径相同,并且将USE_INT8 替换USE_FP16,然后再重新执行cmake和make;

3.遇到的错误:trt 版本为 7.2 时,运行,转换engine 命令,出现下面错误:

terminate called after throwing an instance of ‘std::out_of_range’
what(): _Map_base::at

在这里插入图片描述

4.trt 版本为8.0,8.2 , 8.4 时,运行 ,转换engine命令,出现下面错误:

void APIToModel(unsigned int, nvinfer1::IHostMemory**, bool&, float&, float&, std::__cxx11::string&): Assertion `engine != nullptr’ failed.

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44312422/article/details/127229614