Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
efdebd70
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,发现更多精彩内容 >>
提交
efdebd70
编写于
1月 29, 2018
作者:
W
wuchenghui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add dsp_mode parameter
上级
e3f704c4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
2 deletion
+11
-2
hexagon/libhexagon_controller.so
hexagon/libhexagon_controller.so
+0
-0
python/tools/tf_converter.py
python/tools/tf_converter.py
+6
-1
python/tools/tf_dsp_converter_lib.py
python/tools/tf_dsp_converter_lib.py
+5
-1
未找到文件。
hexagon/libhexagon_controller.so
浏览文件 @
efdebd70
无法预览此类型文件
python/tools/tf_converter.py
浏览文件 @
efdebd70
...
...
@@ -32,7 +32,7 @@ def main(unused_args):
if
FLAGS
.
runtime
==
'dsp'
:
output_graph_def
=
tf_dsp_converter_lib
.
convert_to_mace_pb
(
input_graph_def
,
FLAGS
.
input_node
,
FLAGS
.
output_node
)
input_graph_def
,
FLAGS
.
input_node
,
FLAGS
.
output_node
,
FLAGS
.
dsp_mode
)
else
:
output_graph_def
=
tf_converter_lib
.
convert_to_mace_pb
(
input_graph_def
,
FLAGS
.
input_node
,
FLAGS
.
output_node
,
FLAGS
.
data_type
,
FLAGS
.
runtime
,
FLAGS
.
winograd
)
...
...
@@ -119,6 +119,11 @@ def parse_args():
const
=
False
,
default
=
False
,
help
=
"open winograd convolution or not"
)
parser
.
add_argument
(
"--dsp_mode"
,
type
=
int
,
default
=
0
,
help
=
"dsp run mode, defalut=0"
)
return
parser
.
parse_known_args
()
...
...
python/tools/tf_dsp_converter_lib.py
浏览文件 @
efdebd70
...
...
@@ -359,7 +359,7 @@ def fuse_quantize(net_def, input_node, output_node):
new_net_def
.
op
.
extend
(
new_ops
)
return
new_net_def
def
convert_to_mace_pb
(
input_graph_def
,
input_node
,
output_node
):
def
convert_to_mace_pb
(
input_graph_def
,
input_node
,
output_node
,
dsp_mode
):
"""
nnlib does not have batch norm, so use tensorflow optimizer to fold
batch norm with convolution. The fold optimization reorders ops, so
...
...
@@ -394,5 +394,9 @@ def convert_to_mace_pb(input_graph_def, input_node, output_node):
dtype
=
mace_pb2
.
DT_FLOAT
final_net_def
=
add_input_output_info
(
net_def_with_node_id
,
input_node
,
output_node
,
graph
,
dtype
)
arg
=
final_net_def
.
arg
.
add
()
arg
.
name
=
'dsp_mode'
arg
.
i
=
dsp_mode
return
final_net_def
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录