Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.1k stars 4.13k forks source link

ncnn2int8结果飘的厉害 #1664

Open onesnow123q opened 4 years ago

onesnow123q commented 4 years ago

模型是自己裁剪后的mobilenetv3做人脸关键点检测 onnx转为ncnn然后进行optimize,优化后的float32模型检测结果准确 image 使用训练图片5173张进行量化,但是量化后的结果飘的厉害 image 请问这种可能是什么原因呢?

onesnow123q commented 4 years ago

已经尝试过其他issue里面的方法,混合量化之类的方法,效果还是比较差~~

nihui commented 4 years ago

int8量化在分类和检测任务work,回归任务不work是正常的

onesnow123q commented 4 years ago

@nihui 想问一下大神,这个是为什么呢==!这种情况下要怎么做量化操作呢?pytorch模型想要转ncnn在小海思芯片上运行~~多谢~

songh11 commented 2 years ago

请问检测框也是回归,感觉回归任务效果差的话,也会影响检测框的定位,请问是这么理解么

nihui commented 1 month ago

针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn In view of various problems in onnx model conversion, it is recommended to use the latest pnnx tool to convert your model to ncnn

pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224]

详细参考文档 Detailed reference documentation https://github.com/pnnx/pnnx https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx#how-to-use-pnnx