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

Runing mnn-yolo repo yolov5_demo happening crush when MNN Compile with HiAi DDK shard librarys on Huawei Mate X5 devices. #3221

Open
wuhangchen opened this issue Feb 11, 2025 · 15 comments
Labels
bug Something isn't working hiai

Comments

@wuhangchen
Copy link

wuhangchen commented Feb 11, 2025

My purpose: I want to run some general algorithms on the NPU on the HiSilicon Kirin mobile phone chip with Da Vinci architecture, such as the yolov5 example.
My Devices: Huawei Mate X5
My work steps

  1. Download hiai ddk shared librarys.
  2. Refer NPU及其相应后端使用说明 crush compiling MNN. successful and generate libMNN.so libMNNOpenCV.so libMNN_Express.so libMNN_NPU.so.
  3. Then Download mnn-yolo repo, and change the CMakelists.txt refer Android devices. and changes forwardType to MNN_FORWARD_USER_0 and compile success and generate yolov5_demo.
  4. Copy outcome on Huawei Mate X5, then start command such like "./yolov5_demo ./yolov5n.mnn ./test.jpg". it happen segments.

The attached file is crush logs. i hope you can help me with answers. by the ways, i can use cpu/opencl backend successful.

[email protected]

@wuhangchen wuhangchen changed the title Runing mnn-yolo repo yolov5_demo happening segements when MNN Compile with HiAi DDK shard librarys. Runing mnn-yolo repo yolov5_demo happening crush when MNN Compile with HiAi DDK shard librarys. Feb 11, 2025
@wuhangchen wuhangchen changed the title Runing mnn-yolo repo yolov5_demo happening crush when MNN Compile with HiAi DDK shard librarys. Runing mnn-yolo repo yolov5_demo happening crush when MNN Compile with HiAi DDK shard librarys on Huawei Mate X5 devices. Feb 11, 2025
@jxt1234 jxt1234 added bug Something isn't working hiai labels Feb 12, 2025
@yixialiang
Copy link

getprop "ro.vendor.hiaiversion"在手机上执行一下看下版本号

@yixialiang
Copy link

yixialiang commented Feb 12, 2025

可以发下执行日志 adb logcat -c 清除一下日志 然后执行 adb logcat >>log.txt 最后执行一下 ./yolov5_demo ./yolov5n.mnn ./test.jpg

@wuhangchen
Copy link
Author

Question 1:
100.600.020.100
Question 2:

mnn-yolo-npu.log

@yixialiang
Copy link

yixialiang commented Feb 13, 2025

如果你的执行报错为npu Interp not support type: 4Resize error for type = Interp, name = 214
需要在 MNN-master/source/backend/hiai/execution/NPUInterp.cpp 添加 如下图代码

Image

之后如果有报错 unary not support this case : 29
需要在MNN-master/source/backend/hiai/execution/NPUUnary.cpp 下添加如下图代码

Image

然后重新编译下代码

@yixialiang
Copy link

yixialiang commented Feb 13, 2025

下次有报错发送内容,1.截图执行文件界面报错 如下图,2.执行日志报错

Image

@wuhangchen
Copy link
Author

你好,我在adb shell执行中执行只有如下log,完整的adb log在我前一个回复的附件。

Image

@yixialiang
Copy link

yixialiang commented Feb 13, 2025

inputsize cannot tans output 没有在mnn代码里面找到你的报错 你的 adb log日志显示还没有执行到我们hiai的代码 你可以检查下是不是你的测试文件写的有问题

Image 我这边是测试通过的

@yixialiang
Copy link

yixialiang commented Feb 13, 2025

testHiaiIR.txt 这个是我的用例执行文件 执行命令
./testHiaiIR.txt yolov5.mnn

或者把 你的模型发过来我跑下

@yixialiang
Copy link

Image 看你日志里面是打开文件失败

@wuhangchen
Copy link
Author

你好,xialiang同学,这个.cachefile是mnn里面使用cache来加速后面的启动,第一次加载没有这个.cache目录 所以会有警告,我这边把我完整的mnn-yolo产出包发你呢。看看你那边是否会有失败?里面有我的可执行文件还有模型文件,这个模型文件来源于mnn-yolo仓库直接下载的。

@wuhangchen
Copy link
Author

@yixialiang
Copy link

yixialiang commented Feb 17, 2025

由于内部有限制你的压缩包我下载不了,你用我的执行用例文件可以执行吗 你发下你的原模型onnx yolov5n.onnx链接

@wuhangchen
Copy link
Author

Image执行你的可执行文件需要vulkun,方便把你的so也打包一下吗? 我的模型是直接从https://github.com/wangzhaode/mnn-yolo 这儿下载的, 你可以下载。

Image

@yixialiang
Copy link

yixialiang commented Feb 18, 2025

我看到这个报错了是因为我们的网络不支持5维度的

https://github.com/meituan/YOLOv6/tree/main/deploy/ONNX yolov6是支持的
https://github.com/wangzhaode/mnn-yolo?tab=readme-ov-file

@wuhangchen
Copy link
Author

okey,我这边尝试一下。感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hiai
Projects
None yet
Development

No branches or pull requests

3 participants