marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.38k stars 343 forks source link

INT8 Quantization - calibration table missing #282

Open costaz9 opened 1 year ago

costaz9 commented 1 year ago

Hi, I'm using your repo to run inference on live camera stream with YoloV5 (Jetson Nano - DeepStream-6). The engine work well using FP32 or FP16.

However, I'm trying to convert the model with int8 quantization, and I followed your guide:

The problem is that te calibration table (calib.table) is not generated during the above steps. Do you have any suggestions to solve this problem and perform integer quantization, or there are other related issues?.

Thanks for your time.

Alberto1404 commented 1 year ago

That happened to me as well. Check this I solved it removing everything and doing it again in my Jetson, following this guide: https://docs.ultralytics.com/tutorials/nvidia-jetson/#int8-calibration. It suddenly began working for me.

ClydeU420 commented 1 year ago

That happened to me as well. Check this I solved it removing everything and doing it again in my Jetson, following this guide: https://docs.ultralytics.com/tutorials/nvidia-jetson/#int8-calibration. It suddenly began working for me.

I found your link first, but it didn't work for me

marcoslucianops commented 1 year ago

Hi. You need to compile the nvdsinfer_custom_impl_Yolo with OpenCV to make the calibration. Did you do it?

Muammer06 commented 1 year ago

hi, you should need train first with calibration images, after that step calib.table is generated and no longer need calibration images. @costaz9 @ClydeU420

avn3r commented 11 months ago

This error is because you need to clean the lib before recreating the lib with OpenCV.

rm -rf nvdsinfer_custom_impl_Yolo/*.o
rm -rf nvdsinfer_custom_impl_Yolo/*.so
CUDA_VER=<YOUR-CUDA> OPENCV=1 make -C nvdsinfer_custom_impl_Yolo

@marcoslucianops You might want to add this in the tutorial. Basically if the lib has been created running the lib wont reinstall it with OpenCV. So you have to clean the make and then reinstall.

marcoslucianops commented 11 months ago

@avn3r You can run

CUDA_VER=<YOUR-CUDA> OPENCV=1 make -C nvdsinfer_custom_impl_Yolo clean

To remove the old files and run the

CUDA_VER=<YOUR-CUDA> OPENCV=1 make -C nvdsinfer_custom_impl_Yolo

To compile.

avn3r commented 11 months ago

@marcoslucianops Thanks, that's an even cleaner solution. I'm unblocked on this end. It was more about potentially adding this to the INT8 quantization doc to avoid others from getting this error.

Thanks for your work!