PaddlePaddle / PaddleSlim

PaddleSlim is an open-source library for deep model compression and architecture search.
https://paddleslim.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.56k stars 345 forks source link

act 自动压缩pytorch_yolo实例中,python onnx--> tensorrt int8推理结果异常 #1834

Open GDbbq opened 9 months ago

GDbbq commented 9 months ago

设备

unbuntu20 nvidia 1080ti cuda 11.7 ternsorrt 8.6 paddleslim 2.6 paddle 2.6

复现过程

  1. 下载链接提供yolov5s.onnx, 跑pytorch_yolo_series样例,得到量化后模型
  2. onnx推理预测,fp32 和 fp16结果均正常, int8没有框;
  3. 运行时,加载tensort模型会打印的消息,可能是造成结果异常的原因;fp32 和 fp16也会打印下面的内容,但是输出的图片结果是正常的。如下图,正常输出的结果
    [01/16/2024-03:40:10] [TRT] [E] 3: [executionContext.cpp::setBindingDimensions::1513] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::setBindingDimensions::1513, condition: engineDims.nbDims == dims.nbDims
    )

    output

lizexu123 commented 9 months ago

这个[01/16/2024-03:40:10] [TRT] [E] 3: [executionContext.cpp::setBindingDimensions::1513] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::setBindingDimensions::1513, condition: engineDims.nbDims == dims.nbDims )应该是没什么影响,能跑通就没事,int8的结果正确吗