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

pnnx转换yolov7模型带来未知原因精度损失 #5712

Open
XJTUWYD opened this issue Sep 25, 2024 · 0 comments
Open

pnnx转换yolov7模型带来未知原因精度损失 #5712

XJTUWYD opened this issue Sep 25, 2024 · 0 comments

Comments

@XJTUWYD
Copy link

XJTUWYD commented Sep 25, 2024

error log | 日志或报错信息 | ログ
原项目地址:https://github.com/derronqi/yolov7-face
关于ncnn的代码在https://github.com/derronqi/yolov7-face/tree/main/cpp 中,我用export.py完成模型到onnx的转换,然后使用最新版的pnnx完成onnx到ncnn的转换(也尝试过pt-> pt script->ncnn也有问题)。
pt的模型地址
使用pt模型测试325*352的结果是正确的,但是转换为ncnn之后测试结果就不正确了,初步判断有可能是模型转换带来精度损失导致的。

context | 编译/运行环境 | バックグラウンド
最新版本的pnnx和ncnn

how to reproduce | 复现步骤 | 再現方法
1.下载模型
2.使用https://github.com/derronqi/yolov7-face/blob/main/cpp/export.py 进行onnx转换
3.使用ncnn的转换工具pnnx把onnx模型转换为ncnn模型(shape = [1,3, 352, 352])
4.转换好的模型放入https://github.com/derronqi/yolov7-face/tree/main/cpp/yolov7-face-ncnn 中的models
5.修改https://github.com/derronqi/yolov7-face/blob/main/cpp/yolov7-face-ncnn/include/yolov7face.h 中的YOLOFACE_INPUT_WIDTH为352 YOLOFACE_INPUT_HEIGHT为352。
6.修改https://github.com/derronqi/yolov7-face/blob/main/cpp/yolov7-face-ncnn/src/main.cpp 第15行的模型名字,进行测试。

more | 其他 | その他

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