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

自己训练的模型yolo11导出ncnn格式文件后,部署在安卓上闪退;而官方自带导出后能正常运行,可能是什么问题呢? #5795

Open
tianqi0072600 opened this issue Nov 25, 2024 · 6 comments

Comments

@tianqi0072600
Copy link

detail | 详细描述 | 詳細な説明

导出方法 yolo11

from ultralytics import YOLO
model = YOLO("model/segment/best_n.pt")
model.export( format="ncnn", simplify=True, opset=12)

自己训练的模型yolo11导出ncnn格式文件后,部署在安卓上闪退;而官方自带导出后能正常运行,可能是什么问题呢?

@huazhusun
Copy link

我也有类似情况。几年前转的老ncnn模型可以用最新的ncnn安卓库正常运行,但是pnnx转换的ncnn模型在android上一执行 extractor.extract("out0", out);就直接crash了,在x86/X64平台上倒是没问题。

@tianqi0072600
Copy link
Author

我也有类似情况。几年前转的老ncnn模型可以用最新的ncnn安卓库正常运行,但是pnnx转换的ncnn模型在android上一执行 extractor.extract("out0", out);就直接crash了,在x86/X64平台上倒是没问题。

我用Netron看了下源码自带的param和我导出的param;发现自带的有out0,out1和out2 ;而我自己训练的只有out0; 然后我尝试了下,发现Detect后的返回 objects中的labelid和prob全是非常大的值;分析应该是在模型推理过程中已经出错了,也不知道是哪里不兼容,目前已经卡在这里了~~

@compilerM
Copy link

有可能是的安卓上的C++代码里面的label和模型对应不上,我用的android-yolov8就出现了这样的情况

@0010-0100
Copy link

不知道是什么原因难受死了

@tianqi0072600
Copy link
Author

不知道是什么原因难受死了

目前大概确认了问题,就和上面说的情况一样,ncnn输出需要3个(output) 和一个输入(input) ;而目前的yolo11自带的输出工具导出ncnn后,只有一个输出和一个输入,导致模型和 ncnn不兼容;需要调整yolo11的导出代码,目前还在继续摸索中~~

@ljchengx
Copy link

一样的问题,话说官方也不用yolo11吗

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

5 participants