Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it support quantization? #6

Open
yrik opened this issue Jun 23, 2023 · 5 comments
Open

Does it support quantization? #6

yrik opened this issue Jun 23, 2023 · 5 comments
Labels
question Further information is requested

Comments

@yrik
Copy link

yrik commented Jun 23, 2023

I want to improve FPS on Raspberry PI. Does it make sense to look into 16 or 8 bit quantization? Would be possible to run it with this code?

@Qengineering Qengineering added the question Further information is requested label Jun 23, 2023
@Qengineering
Copy link
Owner

It all depends on the quantization tool of the ncnn framework.

As you no doubt know, deep learning models consist of many layers with different operations.
As time goes by, many new operations are introduced by the deep learning community, giving programmers the noble task of implementing them in their frameworks.
Here comes the question of whether an operation can be transferred to INT8 (or INT16). Sometimes it just can't. Sometimes only by a few tricks. YoloV8 is a relatively new model, so don't be surprised if quantization fails.
Look for an example of your adventure on this site: https://blog.csdn.net/weixin_45829462/article/details/119787840

@yrik
Copy link
Author

yrik commented Jun 23, 2023

Thank you for the detailed response. The article by the link is very interesting. I was thinking to use quantization from Ultralytics (they have it out of the box) and then exporting it further. But it seems it's much more adventurous task to solve.

@Qengineering
Copy link
Owner

Keep in mind that exporting Ultralytics YoloV5 or YoloV8 can be an adventure when it comes to ncnn. See: Tencent/ncnn#4541
Especially the already quantized version are notorious issue generators.

@yrik
Copy link
Author

yrik commented Jun 23, 2023

Thanks! How would you recommend overall to approach the topic of further speed up of this model on raspberry pi?

@Qengineering
Copy link
Owner

  1. Try quantization, just as you suggested. Keep in mind that it can fail.
  2. Try overclocking (simple and works always).
  3. If possible reduce input size 320x320 is faster than 416x416, which on its turn is faster than 640x640 (must be dividable by 32)
  4. If possible try another model like YoloX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants