Files
FastDeploy/docs/en/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

1.8 KiB

English | 中文

Export Model

Introduction

Fastdeploy has simply integrated the onnx->rknn conversion process. In this instruction, we first write yaml configuration files, then export models in tools/export.py. Before you start the conversion, please check if the environment is installed successfully referring to RKNN-Toolkit2 Installation.

Configuration Parameter in export.py

Parameter Whether it can be NULL Parameter Role
verbose Y(DEFAULT=TRUE) Decide whether to output specific information when converting
config_path N Path to configuration file

Config File Introduction

Module of config yaml file

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 parameters

  • model_path: Model saving path.
  • output_folder: Model saving folder name.
  • target_platform: The device model runs on, only RK3588 or RK3568 can be chosen.
  • normalize: Configure the normalize operation on NPU with two parameters std and mean.
    • std: If you do the normalize operation externally, please configure to [1/255,1/255,1/255].
    • mean: If you do the normalize operation externally, please configure to [0,0,0].
  • outputs: Output node list, if you use default output node, please configure to None.

How to convert model

Run the line in the root directory:

python tools/export.py  --config_path=./config.yaml

Things to note in Model Export

  • Please don't export models with softmax or argmax, calculate them externally instead.