Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
Mace
提交
2b385031
Mace
项目概览
慢慢CG
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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看板
提交
2b385031
编写于
3月 01, 2018
作者:
Y
yejianwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove TF_ prefix
上级
7c96f8cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
16 deletion
+14
-16
example.yaml
example.yaml
+6
-6
generate_model_code.sh
generate_model_code.sh
+3
-3
mace_tools.py
mace_tools.py
+2
-4
validate_tools.sh
validate_tools.sh
+3
-3
未找到文件。
example.yaml
浏览文件 @
2b385031
...
@@ -5,18 +5,18 @@ target_abi: armeabi-v7a # arm64-v8a
...
@@ -5,18 +5,18 @@ target_abi: armeabi-v7a # arm64-v8a
embed_model_data
:
1
embed_model_data
:
1
models
:
models
:
preview_net
:
preview_net
:
tf_
model_file_path
:
path/to/model64.pb
model_file_path
:
path/to/model64.pb
tf_
input_node
:
input
input_node
:
input
tf_
output_node
:
softmax/Reshape_1
output_node
:
softmax/Reshape_1
input_shape
:
1,64,64,3
input_shape
:
1,64,64,3
output_shape
:
1,64,64,2
output_shape
:
1,64,64,2
runtime
:
gpu
runtime
:
gpu
limit_opencl_kernel_time
:
0
limit_opencl_kernel_time
:
0
dsp_mode
:
0
dsp_mode
:
0
capture_net
:
capture_net
:
tf_
model_file_path
:
path/to/model256.pb
model_file_path
:
path/to/model256.pb
tf_
input_node
:
input_node
input_node
:
input_node
tf_
output_node
:
softmax/Reshape_1
output_node
:
softmax/Reshape_1
input_shape
:
1,256,256,3
input_shape
:
1,256,256,3
output_shape
:
1,256,256,2
output_shape
:
1,256,256,2
runtime
:
gpu
runtime
:
gpu
...
...
generate_model_code.sh
浏览文件 @
2b385031
...
@@ -15,10 +15,10 @@ if [ "${BENCHMARK_FLAG}" = "1" ]; then
...
@@ -15,10 +15,10 @@ if [ "${BENCHMARK_FLAG}" = "1" ]; then
OBFUSCATE
=
False
OBFUSCATE
=
False
fi
fi
bazel-bin/lib/python/tools/tf_converter
--input
=
${
TF_
MODEL_FILE_PATH
}
\
bazel-bin/lib/python/tools/tf_converter
--input
=
${
MODEL_FILE_PATH
}
\
--output
=
${
MODEL_CODEGEN_DIR
}
/model.cc
\
--output
=
${
MODEL_CODEGEN_DIR
}
/model.cc
\
--input_node
=
${
TF_
INPUT_NODE
}
\
--input_node
=
${
INPUT_NODE
}
\
--output_node
=
${
TF_
OUTPUT_NODE
}
\
--output_node
=
${
OUTPUT_NODE
}
\
--data_type
=
${
DATA_TYPE
}
\
--data_type
=
${
DATA_TYPE
}
\
--runtime
=
${
RUNTIME
}
\
--runtime
=
${
RUNTIME
}
\
--output_type
=
source
\
--output_type
=
source
\
...
...
mace_tools.py
浏览文件 @
2b385031
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Must run at root dir of libmace project.
# Must run at root dir of libmace project.
# python tools/mace_tools.py \
# python tools/mace_tools.py \
# --config=
models/config
\
# --config=
tools/example.yaml
\
# --round=100 \
# --round=100 \
# --mode=all
# --mode=all
...
@@ -15,8 +15,6 @@ import yaml
...
@@ -15,8 +15,6 @@ import yaml
from
ConfigParser
import
ConfigParser
from
ConfigParser
import
ConfigParser
tf_model_file_dir_key
=
"TF_MODEL_FILE_DIR"
def
run_command
(
command
):
def
run_command
(
command
):
print
(
"Run command: {}"
.
format
(
command
))
print
(
"Run command: {}"
.
format
(
command
))
...
@@ -204,7 +202,7 @@ def main(unused_args):
...
@@ -204,7 +202,7 @@ def main(unused_args):
os
.
environ
[
key
.
upper
()]
=
str
(
model_config
[
key
])
os
.
environ
[
key
.
upper
()]
=
str
(
model_config
[
key
])
model_output_dir
=
FLAGS
.
output_dir
+
"/"
+
target_abi
+
"/"
+
os
.
path
.
splitext
(
model_output_dir
=
FLAGS
.
output_dir
+
"/"
+
target_abi
+
"/"
+
os
.
path
.
splitext
(
model_config
[
"
tf_
model_file_path"
])[
0
]
model_config
[
"model_file_path"
])[
0
]
model_output_dirs
.
append
(
model_output_dir
)
model_output_dirs
.
append
(
model_output_dir
)
if
FLAGS
.
mode
==
"build"
or
FLAGS
.
mode
==
"all"
:
if
FLAGS
.
mode
==
"build"
or
FLAGS
.
mode
==
"all"
:
...
...
validate_tools.sh
浏览文件 @
2b385031
...
@@ -23,12 +23,12 @@ if [ "$GENERATE_DATA_OR_NOT" = 1 ]; then
...
@@ -23,12 +23,12 @@ if [ "$GENERATE_DATA_OR_NOT" = 1 ]; then
else
else
rm
-rf
${
MODEL_OUTPUT_DIR
}
/
${
OUTPUT_FILE_NAME
}
rm
-rf
${
MODEL_OUTPUT_DIR
}
/
${
OUTPUT_FILE_NAME
}
adb </dev/null pull
${
PHONE_DATA_DIR
}
/
${
OUTPUT_FILE_NAME
}
${
MODEL_OUTPUT_DIR
}
adb </dev/null pull
${
PHONE_DATA_DIR
}
/
${
OUTPUT_FILE_NAME
}
${
MODEL_OUTPUT_DIR
}
python tools/validate.py
--model_file
${
TF_
MODEL_FILE_PATH
}
\
python tools/validate.py
--model_file
${
MODEL_FILE_PATH
}
\
--input_file
${
MODEL_OUTPUT_DIR
}
/
${
INPUT_FILE_NAME
}
\
--input_file
${
MODEL_OUTPUT_DIR
}
/
${
INPUT_FILE_NAME
}
\
--mace_out_file
${
MODEL_OUTPUT_DIR
}
/
${
OUTPUT_FILE_NAME
}
\
--mace_out_file
${
MODEL_OUTPUT_DIR
}
/
${
OUTPUT_FILE_NAME
}
\
--mace_runtime
${
RUNTIME
}
\
--mace_runtime
${
RUNTIME
}
\
--input_node
${
TF_
INPUT_NODE
}
\
--input_node
${
INPUT_NODE
}
\
--output_node
${
TF_
OUTPUT_NODE
}
\
--output_node
${
OUTPUT_NODE
}
\
--input_shape
${
INPUT_SHAPE
}
\
--input_shape
${
INPUT_SHAPE
}
\
--output_shape
${
OUTPUT_SHAPE
}
--output_shape
${
OUTPUT_SHAPE
}
fi
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录