Files
FastDeploy/docs/cn/faq/rknpu2/export.md
charl-u 02eab973ce [Doc]Add English version of documents in docs/cn and api/vision_results (#931)
* 第一次提交

* 补充一处漏翻译

* deleted:    docs/en/quantize.md

* Update one translation

* Update en version

* Update one translation in code

* Standardize one writing

* Standardize one writing

* Update some en version

* Fix a grammer problem

* Update en version for api/vision result

* Merge branch 'develop' of https://github.com/charl-u/FastDeploy into develop

* Checkout the link in README in vision_results/ to the en documents

* Modify a title

* Add link to serving/docs/

* Finish translation of demo.md
2022-12-22 18:15:01 +08:00

51 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[English](../../../en/faq/rknpu2/export.md) | 中文
# 导出模型指南
## 简介
Fastdeploy已经简单的集成了onnx->rknn的转换过程。本教程使用tools/export.py文件导出模型在导出之前需要编写yaml配置文件。
在进行转换前请根据[rknn_toolkit2安装文档](./install_rknn_toolkit2.md)检查环境是否已经安装成功。
## export.py 配置参数介绍
| 参数名称 | 是否可以为空 | 参数作用 |
|-----------------|------------|--------------------|
| verbose | 是默认值为True | 是否在屏幕上输出转换模型时的具体信息 |
| config_path | 否 | 配置文件路径 |
## config 配置文件介绍
### config yaml文件模版
```yaml
model_path: ./portrait_pp_humansegv2_lite_256x144_pretrained.onnx
output_folder: ./
target_platform: RK3588
normalize:
mean: [[0.5,0.5,0.5]]
std: [[0.5,0.5,0.5]]
outputs: None
```
### config 配置参数介绍
* model_path: 模型储存路径
* output_folder: 模型储存文件夹名字
* target_platform: 模型跑在哪一个设备上只能为RK3588或RK3568
* normalize: 配置在NPU上的normalize操作有std和mean两个参数
* std: 如果在外部做normalize操作请配置为[1/255,1/255,1/255]
* mean: 如果在外部做normalize操作请配置为[0,0,0]
* outputs: 输出节点列表如果使用默认输出节点请配置为None
## 如何转换模型
根目录下执行以下代码
```bash
python tools/export.py --config_path=./config.yaml
```
## 模型导出要注意的事项
* 请不要导出带softmax和argmax的模型这两个算子存在bug请在外部进行运算