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

int8量化的模型与预期大小不符 #5889

Open
cxy2333-hue opened this issue Jan 24, 2025 · 1 comment
Open

int8量化的模型与预期大小不符 #5889

cxy2333-hue opened this issue Jan 24, 2025 · 1 comment

Comments

@cxy2333-hue
Copy link

使用的fp32模型已打包如下

fp32model.zip

量化使用的数据集WIDERFACE中的WIDER Face Testing Images中的16--Award_Ceremony:

下载地址:https://drive.google.com/file/d/1HIfDbVEWKmsYKJZm4lchTBDLW5N7dY5T/view

详细描述

依次使用onnx2ncnn → ncnnoptimize → ncnn2table →ncnn2int8

最终生成的int8模型大小与fp32模型的大小对比如下,int8模型与预期大小不符

-rw-rw-r-- 1 tjy tjy 3.9M Jan 24 13:38 hand_landmark_lite.bin
-rw-rw-r-- 1 tjy tjy 3.4M Jan 24 13:38 hand_landmark_lite-int8.bin
-rw-rw-r-- 1 tjy tjy 34K Jan 24 13:38 hand_landmark_lite-int8.param
-rw-rw-r-- 1 tjy tjy 3.9M Jan 24 13:38 hand_landmark_lite-opt.bin
-rw-rw-r-- 1 tjy tjy 34K Jan 24 13:38 hand_landmark_lite-opt.param
-rw-rw-r-- 1 tjy tjy 55K Jan 24 13:38 hand_landmark_lite.param
-rw-rw-r-- 1 tjy tjy 4.0M Jan 24 13:38 hand_landmark_lite-sim.onnx
-rw-rw-r-- 1 tjy tjy 133K Jan 24 13:38 hand_landmark_lite.table

详细命令:

onnx2ncnn hand_landmark_lite-sim.onnx
hand_landmark_lite.param
hand_landmark_lite.bin

ncnnoptimize hand_landmark_lite.param
hand_landmark_lite.bin
hand_landmark_lite-opt.param
hand_landmark_lite-opt.bin
0

ncnn2table hand_landmark_lite-opt.param
hand_landmark_lite-opt.bin
mydataset.txt
hand_landmark_lite.table
mean=[0,0,0]
norm=[0.003922,0.003922,0.003922]
norm=[0.003922,0.003922,0.003922]
shape=[224,224,3]
pixel=RGB
thread=8
method=aciq

ncnn2int8 hand_landmark_lite-opt.param
hand_landmark_lite-opt.bin
hand_landmark_lite-int8.param
hand_landmark_lite-int8.bin
hand_landmark_lite.table

@cxy2333-hue
Copy link
Author

ncnn2table 那里多打了一行norm=[0.003922,0.003922,0.003922]

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

No branches or pull requests

1 participant