Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
18c20026
Mace
项目概览
Xiaomi
/
Mace
通知
106
Star
40
Fork
27
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
18c20026
编写于
6月 29, 2018
作者:
L
Liangliang He
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'cherry-pick-6499b185' into 'master'
Merge branch 'mnmt' into 'master' See merge request !620
上级
7c8589f8
91244e38
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
7 deletion
+40
-7
mace/python/tools/converter_tool/tensorflow_converter.py
mace/python/tools/converter_tool/tensorflow_converter.py
+10
-1
tools/sh_commands.py
tools/sh_commands.py
+30
-6
未找到文件。
mace/python/tools/converter_tool/tensorflow_converter.py
浏览文件 @
18c20026
...
...
@@ -318,7 +318,16 @@ class TensorflowConverter(base_converter.ConverterInterface):
else
:
mace_check
(
False
,
"data type %s not supported"
%
dtype
)
except
ValueError
:
data_type_arg
.
i
=
self
.
_option
.
data_type
try
:
dtype
=
tf_op
.
get_attr
(
'SrcT'
)
if
dtype
==
tf
.
int32
or
dtype
==
tf
.
bool
:
data_type_arg
.
i
=
mace_pb2
.
DT_INT32
elif
dtype
==
tf
.
float32
:
data_type_arg
.
i
=
self
.
_option
.
data_type
else
:
mace_check
(
False
,
"data type %s not supported"
%
dtype
)
except
ValueError
:
data_type_arg
.
i
=
self
.
_option
.
data_type
ConverterUtil
.
add_data_format_arg
(
op
,
DataFormat
.
NHWC
)
...
...
tools/sh_commands.py
浏览文件 @
18c20026
...
...
@@ -773,10 +773,13 @@ def tuning_run(abi,
(
phone_data_dir
,
os
.
path
.
basename
(
opencl_binary_file
)),
])
adb_cmd
=
' '
.
join
(
adb_cmd
)
adb_cmd_file
=
"%s/%s"
%
(
phone_data_dir
,
'cmd_file'
)
with
open
(
'/tmp/mace_cmd_file'
,
'w'
)
as
cmd_file
:
cmd_file_name
=
"%s-%s-%s"
%
(
'cmd_file'
,
model_tag
,
str
(
time
.
time
()))
adb_cmd_file
=
"%s/%s"
%
(
phone_data_dir
,
cmd_file_name
)
tmp_cmd_file
=
"%s/%s"
%
(
'/tmp'
,
cmd_file_name
)
with
open
(
tmp_cmd_file
,
'w'
)
as
cmd_file
:
cmd_file
.
write
(
adb_cmd
)
adb_push
(
'/tmp/mace_cmd_file'
,
adb_cmd_file
,
serialno
)
adb_push
(
tmp_cmd_file
,
adb_cmd_file
,
serialno
)
os
.
remove
(
tmp_cmd_file
)
sh
.
adb
(
"-s"
,
...
...
@@ -790,7 +793,17 @@ def tuning_run(abi,
stdout
=
""
.
join
(
stdout_buff
)
if
not
stdout_success
(
stdout
):
common
.
MaceLogger
.
error
(
"Mace Run"
,
"Mace run failed."
)
sh
.
adb
(
"-s"
,
serialno
,
"shell"
,
"rm"
,
adb_cmd_file
,
_fg
=
True
)
print
(
"Running finished!
\n
"
)
return
stdout
...
...
@@ -1190,10 +1203,13 @@ def benchmark_model(abi,
(
phone_data_dir
,
os
.
path
.
basename
(
opencl_binary_file
)),
]
adb_cmd
=
' '
.
join
(
adb_cmd
)
adb_cmd_file
=
"%s/%s"
%
(
phone_data_dir
,
'cmd_file'
)
with
open
(
'/tmp/mace_cmd_file'
,
'w'
)
as
cmd_file
:
cmd_file_name
=
"%s-%s-%s"
%
(
'cmd_file'
,
model_tag
,
str
(
time
.
time
()))
adb_cmd_file
=
"%s/%s"
%
(
phone_data_dir
,
cmd_file_name
)
tmp_cmd_file
=
"%s/%s"
%
(
'/tmp'
,
cmd_file_name
)
with
open
(
tmp_cmd_file
,
'w'
)
as
cmd_file
:
cmd_file
.
write
(
adb_cmd
)
adb_push
(
'/tmp/mace_cmd_file'
,
adb_cmd_file
,
serialno
)
adb_push
(
tmp_cmd_file
,
adb_cmd_file
,
serialno
)
os
.
remove
(
tmp_cmd_file
)
sh
.
adb
(
"-s"
,
...
...
@@ -1203,6 +1219,14 @@ def benchmark_model(abi,
adb_cmd_file
,
_fg
=
True
)
sh
.
adb
(
"-s"
,
serialno
,
"shell"
,
"rm"
,
adb_cmd_file
,
_fg
=
True
)
print
(
"Benchmark done!
\n
"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录