Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
36011aaa
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
36011aaa
编写于
10月 30, 2018
作者:
Y
yangfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cl_kernel and test files
上级
893a19b2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
18 deletion
+17
-18
test/CMakeLists.txt
test/CMakeLists.txt
+3
-3
test/net/test_mobilenet.cpp
test/net/test_mobilenet.cpp
+6
-6
tools/android-debug-script/push2android.sh
tools/android-debug-script/push2android.sh
+8
-9
未找到文件。
test/CMakeLists.txt
浏览文件 @
36011aaa
...
...
@@ -217,9 +217,9 @@ else ()
# ADD_EXECUTABLE(test-depthwise-conv-op operators/test_depthwise_conv_op.cpp test_helper.h test_include.h executor_for_test.h)
# target_link_libraries(test-depthwise-conv-op paddle-mobile)
#
#
# gen test
#
ADD_EXECUTABLE(test-mobilenet net/test_mobilenet.cpp test_helper.h test_include.h executor_for_test.h)
#
target_link_libraries(test-mobilenet paddle-mobile)
# gen test
ADD_EXECUTABLE
(
test-mobilenet net/test_mobilenet.cpp test_helper.h test_include.h executor_for_test.h
)
target_link_libraries
(
test-mobilenet paddle-mobile
)
#
# # gen test
# ADD_EXECUTABLE(test-conv-add-relu-op operators/test_conv_add_relu_op.cpp test_helper.h test_include.h executor_for_test.h)
...
...
test/net/test_mobilenet.cpp
浏览文件 @
36011aaa
...
...
@@ -19,14 +19,14 @@ limitations under the License. */
int
main
()
{
paddle_mobile
::
PaddleMobile
<
paddle_mobile
::
CPU
>
paddle_mobile
;
paddle_mobile
.
SetThreadNum
(
4
);
auto
time1
=
time
();
auto
time1
=
paddle_mobile
::
time
();
// auto isok = paddle_mobile.Load(std::string(g_mobilenet_detect) + "/model",
// std::string(g_mobilenet_detect) + "/params", true);
auto
isok
=
paddle_mobile
.
Load
(
g_mobilenet
,
true
);
if
(
isok
)
{
auto
time2
=
time
();
std
::
cout
<<
"load cost :"
<<
time_diff
(
time1
,
time1
)
<<
"ms"
<<
std
::
endl
;
auto
time2
=
paddle_mobile
::
time
();
std
::
cout
<<
"load cost :"
<<
paddle_mobile
::
time_diff
(
time1
,
time1
)
<<
"ms"
<<
std
::
endl
;
std
::
vector
<
float
>
input
;
std
::
vector
<
int64_t
>
dims
{
1
,
3
,
224
,
224
};
...
...
@@ -42,13 +42,13 @@ int main() {
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
auto
vec_result
=
paddle_mobile
.
Predict
(
input
,
dims
);
}
auto
time3
=
time
();
auto
time3
=
paddle_mobile
::
time
();
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
auto
vec_result
=
paddle_mobile
.
Predict
(
input
,
dims
);
}
DLOG
<<
vec_result
;
auto
time4
=
time
();
std
::
cout
<<
"predict cost :"
<<
time_diff
(
time3
,
time4
)
/
10
<<
"ms"
auto
time4
=
paddle_mobile
::
time
();
std
::
cout
<<
"predict cost :"
<<
paddle_mobile
::
time_diff
(
time3
,
time4
)
/
10
<<
"ms"
<<
std
::
endl
;
}
...
...
tools/android-debug-script/push2android.sh
浏览文件 @
36011aaa
#!/usr/bin/env sh
push_fn
()
{
cp
../../src/operators/kernel/cl/cl_kernel/
*
../../build/release/arm-v7a/build/cl_kernel/
MODELS_PATH
=
"../../test/models/*"
MODELS_SRC
=
"../../test/models"
IMAGE_PATH
=
"../../test/images/*"
EXE_FILE
=
"../../test/build/*"
EXE_DIR
=
"data/local/tmp/bin"
adb shell
mkdir
${
EXE_DIR
}
MODELS_DIR
=
"
data/local/tmp/models
"
MODELS_DIR
=
"
/data/local/tmp
"
adb shell
mkdir
${
MODELS_DIR
}
for
file
in
`
ls
${
MODELS_SRC
}
`
do
do
adb shell
mkdir
${
MODELS_DIR
}
"/"
${
file
}
done
...
...
@@ -24,11 +19,15 @@ ACL_BUILD_PATH="../../src/operators/kernel/mali/ACL_Android/build/*"
adb push
${
ACL_BUILD_PATH
}
${
EXE_DIR
}
fi
IMAGES_DIR
=
"
data/local/tmp/images
"
IMAGES_DIR
=
"
/data/local/tmp
"
adb shell
mkdir
${
IMAGES_DIR
}
LIB_PATH
=
"../../build/release/arm-v7a/build/*"
adb push
${
EXE_FILE
}
${
EXE_DIR
}
adb push
${
LIB_PATH
}
${
EXE_DIR
}
for
file
in
${
LIB_PATH
}
do
adb push
${
file
}
${
EXE_DIR
}
done
if
[[
$1
!=
"npm"
]]
;
then
adb push
${
IMAGE_PATH
}
${
IMAGES_DIR
}
adb push
${
MODELS_PATH
}
${
MODELS_DIR
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录