File tree Expand file tree Collapse file tree 2 files changed +87
-1
lines changed
Expand file tree Collapse file tree 2 files changed +87
-1
lines changed Original file line number Diff line number Diff line change 3333
3434开发文档主要是关于编译、运行等问题。做为开发者,它可以和贡献文档共同结合使用。
3535* [ iOS] ( https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_ios.md )
36- * [ Android] ( https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_android.md )
36+ * [ Android_CPU] ( https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_android.md )
37+ * [ Android_GPU] ( https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_android_GPU.md )
3738* [ FPGA] ( https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_fpga.md )
3839* [ ARM_LINUX] ( https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_arm_linux.md )
3940
Original file line number Diff line number Diff line change 1+ ## paddle-mobile GPU开发文档
2+
3+ 编译环境配置方法请参考development_android.md文档
4+
5+ 1 . 下载 paddle-mobile
6+
7+ ```
8+ git clone https://github.com/PaddlePaddle/paddle-mobile.git
9+
10+ adb pull /system/vendor/lib/libOpenCL.so paddle-mobile/third_party/opencl
11+
12+ 修改paddle-mobile/CMakeLists.txt文件,执行如下操作:
13+ option(GPU_CL "opencl gpu" OFF)->option(GPU_CL "opencl gpu" ON)
14+
15+ cd paddle-mobile/tools
16+
17+ sh build.sh android
18+
19+ ```
20+ 2 . 将单测可执行文件和模型部署到手机
21+
22+ 下载测试需要的mobilenet和test_image_1x3x224x224_float文件,下载地址:http://mms-graph.bj.bcebos.com/paddle-mobile/opencl_test_src.zip
23+
24+ ```
25+ cd ../test
26+ mkdir models
27+ mkdir images
28+
29+ ```
30+ 将mobilenet复制到paddle-mobile/test/models目录下
31+ 将test_image_1x3x224x224_float复制到paddle-mobile/test/images目录下
32+
33+ 执行下面命令将可执行文件和预测需要的文件部署到手机
34+
35+ ```
36+ cd ../tools/android-debug-script
37+ sh push2android.sh
38+
39+ ```
40+ 3 . 在adb shell中执行对应的可执行文件(目前只支持mobilenet,后续会支持更多的网络模型)
41+
42+ ```
43+ adb shell
44+ cd /data/local/tmp/bin/
45+ export LD_LIBRARY_PATH=.
46+ ./test-mobilenetgpu
47+
48+ ```
49+ 4 . mobilenet cpu模型预测结果
50+
51+ 假设mobilenet和test_image_1x3x224x224_float文件已经推送到手机上,执行下面命令进行mobilenet cpu的预测
52+
53+ ```
54+ adb shell
55+ cd /data/local/tmp/bin/
56+ export LD_LIBRARY_PATH=.
57+ ./test-mobilenet
58+
59+ ```
60+ 5 . 预测结果
61+
62+ 手机型号:小米6(CPU 835,GPU Adreno 540)
63+
64+ mobilenet gpu:预测性能,耗时41ms左右。
65+
66+ mobilenet cpu:
67+
68+ 1线程:108ms
69+ 2线程:65ms
70+ 4线程:38ms
71+
72+ 手机型号:OPPO Findx(CPU 845,GPU Adreno 630)
73+
74+ mobilenet gpu:预测性能,耗时27ms左右。
75+
76+ mobilenet cpu:
77+
78+ 1线程:90ms
79+ 2线程:50ms
80+ 4线程:29ms
81+
82+
83+
84+
85+
You can’t perform that action at this time.
0 commit comments