PaddlePaddle / Paddle-Lite

PaddlePaddle High Performance Deep Learning Inference Engine for Mobile and Edge (飞桨高性能深度学习端侧推理引擎)
https://www.paddlepaddle.org.cn/lite
Apache License 2.0
6.89k stars 1.6k forks source link

padllite amlogic a311d movenet 推理报错 #9071

Closed ljl86092297 closed 5 months ago

ljl86092297 commented 2 years ago

image quant_post_static_model.zip

paddle-bot-old[bot] commented 2 years ago

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网文档常见问题历史Issue来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQ and Github Issue to get the answer.Have a nice day!

hong19860320 commented 2 years ago

看起来是量化模型的部分算子缺失量化信息 out_threshold导致的, @yingshengBD 跟下吧~

hong19860320 commented 2 years ago

image 能把这两个算子从模型里去掉吗? 我看这个div是没有量化的

ljl86092297 commented 2 years ago

可是我用你们的demo iamge_classification_demo 替换成我的模型可以正常跑,你们的demo里的输入是224224 但是我的模型需要的是192192 很奇怪为什么能跑通 如果这两个算子没量化可以正常在cpu上跑吗?

hong19860320 commented 2 years ago

image quant_post_static_model.zip

ARM CPU 上可以正常跑,是因为只有conv2d和fc(可能还有其它少量算子)是跑在 int8 arm kernel上的,其它都是跑在fp32 kernel上的,所以只要确保conv2d和fc的量化信息存在就行。

ljl86092297 commented 2 years ago

image 我已经把没量化的算子去除 可是还是不能正常在npu运行,且其他算子都有out_threshold信息

ljl86092297 commented 2 years ago

[poes_model.zip](https://github.com/PaddlePaddle/Paddle-Lite/files/8785789/poes_model.z

ljl86092297 commented 2 years ago

问题的原因找到了 是因为我在编译中加入了opencv的动态库(无论在源代码都是否使用到) 编译都会通过,在运行时就会报错。 请问这主要是什么原因造成的?

hong19860320 commented 2 years ago

image 我已经把没量化的算子去除 可是还是不能正常在npu运行,且其他算子都有out_threshold信息

@yingshengBD 跟下这个问题吧

hong19860320 commented 2 years ago

问题的原因找到了 是因为我在编译中加入了opencv的动态库(无论在源代码都是否使用到) 编译都会通过,在运行时就会报错。 请问这主要是什么原因造成的?

应该和 OpenCV 没有关系的,这个是芯原 ddk 内部报错,可能是网络中 tensor 维度或量化信息存在问题,需要定位下,@yingshengBD 跟一下吧~

ljl86092297 commented 2 years ago

我实际操作是存在这样的问题,你们可以尝试一下有opencv在芯源npu测试情况,同样的板子cpu就没有问题,可能是其他地方存在冲突 具体我也没有定位(这是我多次测试 以及让我同事也进行了测试确实存在这样的问题)。

ljl86092297 commented 2 years ago

你们的lite full版的编译 无法将cv编译进去 light就可以(所有问题都是包含芯源npu的情况进行的)我是用的就是这个命令行 $ ./lite/tools/build_android.sh --arch=armv7 --toolchain=clang --android_stl=c++_shared --with_extra=ON --with_exception=ON --with_cv=ON --with_log=ON --with_nnadapter=ON --nnadapter_with_verisilicon_timvx=ON --nnadapter_verisilicon_timvx_src_git_tag=main --nnadapter_verisilicon_timvx_viv_sdk_url=http://paddlelite-demo.bj.bcebos.com/devices/verisilicon/sdk/viv_sdk_android_9_armeabi_v7a_6_4_4_3_generic.tgz full_publish

yingshengBD commented 2 years ago

本地已经复现,已反馈给相关开发同学 另外 ,跟npu的编译没有关系