Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
Mace
提交
9c408a6c
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看板
提交
9c408a6c
编写于
7月 05, 2018
作者:
L
liutuo
提交者:
liuqi
7月 09, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
上级
1c589de4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
17 addition
and
24 deletion
+17
-24
docs/user_guide/advanced_usage.rst
docs/user_guide/advanced_usage.rst
+1
-1
docs/user_guide/basic_usage.rst
docs/user_guide/basic_usage.rst
+16
-23
未找到文件。
docs/user_guide/advanced_usage.rst
浏览文件 @
9c408a6c
...
@@ -108,7 +108,7 @@ in one deployment file.
...
@@ -108,7 +108,7 @@ in one deployment file.
adb shell getprop | grep "model\|version.sdk\|manufacturer\|hardware\|platform\|brand"
adb shell getprop | grep "model\|version.sdk\|manufacturer\|hardware\|platform\|brand"
# command for generating sha256_sum
# command for generating sha256_sum
sha256sum path/to/your/file
sha256sum
/
path/to/your/file
=========
=========
...
...
docs/user_guide/basic_usage.rst
浏览文件 @
9c408a6c
...
@@ -36,13 +36,13 @@ Here we use the mobilenet-v2 model as an example.
...
@@ -36,13 +36,13 @@ Here we use the mobilenet-v2 model as an example.
git clone https://github.com/XiaoMi/mace-models.git
git clone https://github.com/XiaoMi/mace-models.git
3. Build
MACE
.
3. Build
a general MACE library
.
.. code:: sh
.. code:: sh
cd path/to/mace
cd path/to/mace
# Build library
# Build library
python tools/converter.py build --config=path/to/mace-models/mobilenet-v2/mobilenet-v2.yml
python tools/converter.py build --config=
/
path/to/mace-models/mobilenet-v2/mobilenet-v2.yml
4. Convert the model to MACE format model.
4. Convert the model to MACE format model.
...
@@ -51,7 +51,7 @@ Here we use the mobilenet-v2 model as an example.
...
@@ -51,7 +51,7 @@ Here we use the mobilenet-v2 model as an example.
cd path/to/mace
cd path/to/mace
# Build library
# Build library
python tools/converter.py build --config=path/to/mace-models/mobilenet-v2/mobilenet-v2.yml
python tools/converter.py build --config=
/
path/to/mace-models/mobilenet-v2/mobilenet-v2.yml
5. Run the model.
5. Run the model.
...
@@ -59,11 +59,11 @@ Here we use the mobilenet-v2 model as an example.
...
@@ -59,11 +59,11 @@ Here we use the mobilenet-v2 model as an example.
.. code:: sh
.. code:: sh
# Test model run time
# Test model run time
python tools/converter.py run --config=path/to/mace-models/mobilenet-v2/mobilenet-v2.yml --round=100
python tools/converter.py run --config=
/
path/to/mace-models/mobilenet-v2/mobilenet-v2.yml --round=100
# Validate the correctness by comparing the results against the
# Validate the correctness by comparing the results against the
# original model and framework, measured with cosine distance for similarity.
# original model and framework, measured with cosine distance for similarity.
python tools/converter.py run --config=path/to/mace-models/mobilenet-v2/mobilenet-v2.yml --validate
python tools/converter.py run --config=
/
path/to/mace-models/mobilenet-v2/mobilenet-v2.yml --validate
Build your own model
Build your own model
...
@@ -75,7 +75,7 @@ This part will show you how to use your pre-trained model in MACE.
...
@@ -75,7 +75,7 @@ This part will show you how to use your pre-trained model in MACE.
1. Prepare your model
1. Prepare your model
======================
======================
Mace now supports models from Tensorflow and Caffe(more frameworks will be supported).
Mace now supports models from Tensorflow and Caffe
(more frameworks will be supported).
- TensorFlow
- TensorFlow
...
@@ -143,23 +143,19 @@ Modify one of them and use it for your own case.
...
@@ -143,23 +143,19 @@ Modify one of them and use it for your own case.
.. literalinclude:: models/demo_app_models_caffe.yml
.. literalinclude:: models/demo_app_models_caffe.yml
:language: yaml
:language: yaml
More details about model deployment file
, please refer to
:doc:`advanced_usage`.
More details about model deployment file
are in
:doc:`advanced_usage`.
======================
======================
3. Convert your model
3. Convert your model
======================
======================
When the deployment file is ready for your model, you can use MACE converter tool to convert your model(s).
When the deployment file is ready, you can use MACE converter tool to convert your model(s).
To convert your pre-trained model to a MACE model, you need to set ``build_type:proto`` in your model deployment file.
And then run this command:
.. code:: bash
.. code:: bash
python tools/converter.py convert --config=
path/to/your/model_deployment
.yml
python tools/converter.py convert --config=
/path/to/your/model_deployment_file
.yml
This command will download or load your pre-trained model and convert it to a MACE model proto file and weights file.
This command will download or load your pre-trained model and convert it to a MACE model proto file and weights
data
file.
The generated model files will be stored in ``build/${library_name}/model`` folder.
The generated model files will be stored in ``build/${library_name}/model`` folder.
.. warning::
.. warning::
...
@@ -171,22 +167,19 @@ The generated model files will be stored in ``build/${library_name}/model`` fold
...
@@ -171,22 +167,19 @@ The generated model files will be stored in ``build/${library_name}/model`` fold
4. Build MACE into a library
4. Build MACE into a library
=============================
=============================
MACE can be built into either a static or a shared library (which is
specified by ``linkshared`` in YAML model deployment file).
Use bazel to build MACE source code into a library.
Use bazel to build MACE source code into a library.
.. code:: sh
.. code:: sh
cd path/to/mace
cd path/to/mace
# Build library
# Build library
bazel build --config
=path/to/your/model_deployment_file.yml
bazel build --config
android mace:libmace --define neon=true --define openmp=true -cpu=arm64-v8a
The above command will generate
library files in the ``build/${library_name}/libs`` folder
.
The above command will generate
a library as ``bazel-bin/mace/libmace.so``
.
.. warning::
.. warning::
1. Please verify th
e target_abis params in the above command and the
deployment file are the same.
1. Please verify th
at the target_abis param in the above command and your
deployment file are the same.
2. If you want to build a library for a specific soc, please refer to :doc:`advanced_usage`.
2. If you want to build a library for a specific soc, please refer to :doc:`advanced_usage`.
...
@@ -204,11 +197,11 @@ to run and validate your model.
...
@@ -204,11 +197,11 @@ to run and validate your model.
.. code:: sh
.. code:: sh
# Test model run time
# Test model run time
python tools/converter.py run --config=path/to/your/model_deployment_file.yml --round=100
python tools/converter.py run --config=
/
path/to/your/model_deployment_file.yml --round=100
# Validate the correctness by comparing the results against the
# Validate the correctness by comparing the results against the
# original model and framework, measured with cosine distance for similarity.
# original model and framework, measured with cosine distance for similarity.
python tools/converter.py run --config=path/to/your/model_deployment_file.yml --validate
python tools/converter.py run --config=
/
path/to/your/model_deployment_file.yml --validate
* **benchmark**
* **benchmark**
...
@@ -217,7 +210,7 @@ to run and validate your model.
...
@@ -217,7 +210,7 @@ to run and validate your model.
.. code:: sh
.. code:: sh
# Benchmark model, get detailed statistics of each Op.
# Benchmark model, get detailed statistics of each Op.
python tools/converter.py benchmark --config=path/to/your/model_deployment_file.yml
python tools/converter.py benchmark --config=
/
path/to/your/model_deployment_file.yml
=======================================
=======================================
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录