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.97k stars 1.61k forks source link

nanopc t4上部署mobilenetv3_yolov3遇到内存不足的问题 #4874

Closed daiyuanm closed 9 months ago

daiyuanm commented 3 years ago

在nano pc t4上用mobilenetv3_yolov3进行目标检测,在预测的时候会出现内存不足的情况,但是后台却显示内存没有用起来,有大佬碰到过这种问题吗。 代码是参照给的安卓demo写的用于arm的代码。 所用的mobilenetv3_yolov3的模型在PC上可以进行检测,之后用opt转换成nb格式,使用自己所写代码就会遇到下面的问题: [W 12/ 1 10:47:50.325 ...e-Lite/lite/model_parser/model_parser.cc:811 LoadModelNaiveFromFile] warning: the version of opt that transformed this model is not consistent with current Paddle-Lite version. version of opt:v2.6.1 version of current Paddle-Lite:0d53f5af [F 12/ 1 10:47:50.970 ...odel_parser/naive_buffer/naive_buffer.cc:30 Consume] Check failed: bytes <= free_size(): 18874368!<=16687912 No free memory of 18874368, should Require the memory first ./run.sh: line 16: 29699 Aborted (core dumped)

juncaipeng commented 3 years ago

T4 上建议用PaddleInference预测部署,请参考:https://paddle-inference.readthedocs.io/en/latest/#

daiyuanm commented 3 years ago

T4 上建议用PaddleInference预测部署,请参考:https://paddle-inference.readthedocs.io/en/latest/#

我目前可以在nano pc t4(rk3399)上在pplite环境下使用mobilenetv3_yolov3进行目标检测了,但是速度很慢,大概需要8s检测一张640的图片。你的意思是我直接在nano pc t4(rk3399)上安装paddlepaddle,然后利用paddleinference预测?

juncaipeng commented 3 years ago

哦,看错了,是rk3399上啊,是应该使用paddlelite。

这个硬件不太熟悉,一般不会这么久吧。是arm cpu架构吗?可以跑下benchmark,对比常见分类模型性能是不是异常。

daiyuanm commented 3 years ago

哦,看错了,是rk3399上啊,是应该使用paddlelite。

这个硬件不太熟悉,一般不会这么久吧。是arm cpu架构吗?可以跑下benchmark,对比常见分类模型性能是不是异常。

是的,arm cpu架构。你说的benchmark是指的这个吗?

longshifeng commented 3 years ago

@daiyuanm 你好,我想问一下 no free memory这个问题怎么解决的么?我是在树莓派4B 端侧部署的。

具体报错如下, [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1064 Setup] ARM multiprocessors name: MODEL NAME : ARMV7 PROCESSOR REV 3 (V7L) HARDWARE : BCM2711

[I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1065 Setup] ARM multiprocessors number: 4 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 0, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 1, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 2, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 3, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1073 Setup] L1 DataCache size is: [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1077 Setup] L2 Cache size is: [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1081 Setup] L3 Cache size is: [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1085 Setup] Total memory: 3919796KB [W 1/ 2 16:13:38.887 ...e-Lite/lite/model_parser/model_parser.cc:811 LoadModelNaiveFromFile] warning: the version of opt that transformed this model is not consistent with current Paddle-Lite version. version of opt:b92e8c4 version of current Paddle-Lite:2708c2fe [F 1/ 2 16:13:38.891 ...odel_parser/naive_buffer/naive_buffer.cc:30 Consume] Check failed: bytes <= free_size(): 8!<=7 No free memory of 8, should Require the memory first

daiyuanm commented 3 years ago

@daiyuanm 你好,我想问一下 no free memory这个问题怎么解决的么?我是在树莓派4B 端侧部署的。

具体报错如下, [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1064 Setup] ARM multiprocessors name: MODEL NAME : ARMV7 PROCESSOR REV 3 (V7L) HARDWARE : BCM2711

[I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1065 Setup] ARM multiprocessors number: 4 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 0, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 1, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 2, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 3, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72 [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1073 Setup] L1 DataCache size is: [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1077 Setup] L2 Cache size is: [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1081 Setup] L3 Cache size is: [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 1/ 2 16:13:38.885 ...nts/Paddle-Lite/lite/core/device_info.cc:1085 Setup] Total memory: 3919796KB [W 1/ 2 16:13:38.887 ...e-Lite/lite/model_parser/model_parser.cc:811 LoadModelNaiveFromFile] warning: the version of opt that transformed this model is not consistent with current Paddle-Lite version. version of opt:b92e8c4 version of current Paddle-Lite:2708c2fe [F 1/ 2 16:13:38.891 ...odel_parser/naive_buffer/naive_buffer.cc:30 Consume] Check failed: bytes <= free_size(): 8!<=7 No free memory of 8, should Require the memory first

我后面是通过更新预测库解决的。可以看一下这个 https://github.com/PaddlePaddle/PaddleDetection/issues/1793

longshifeng commented 3 years ago

@daiyuanm 谢谢!