This is an old revision of the document!
This document will introduce how to use the KSNN conversion tool.
The tool is integrated in the NPU conversion tool warehouse of VIM3.
$ git clone --recursive https://github.com/khadas/aml_npu_sdk.git
The KSNN conversion tool is under acuity-toolkit/python
,
$ cd aml_npu_sdk/acuity-toolkit/python && ls $ convert data outputs
Choose tensorflow Inception V3 as a exmple.
1. Get forzen model,
$ cd aml_npu_sdk/acuity-toolkit/python $ wget https://github.com/yan-wyb/models-zoo/raw/master/tensonrflow/inception/inception_v3_2016_08_28_frozen.pb
2. Convert,
$ ./convert --model-name inception \
> --platform tensorflow \
> --model /home/yan/yan/Yan/models-zoo/tensorflow/inception/inception_v3_2016_08_28_frozen.pb \
> --input-size-list '299,299,3' \
> --inputs input \
> --outputs InceptionV3/Predictions/Reshape_1 \
> --mean-values '128 128 128 0.0078125' \
> --quantized-dtype asymmetric_affine \
> --source-files ./data/dataset/dataset0.txt \
> --kboard VIM3 --print-level 0
During conversion, if you need to view detailed information, you can modify –print-level 0
to –print-level 1
.
3. File generated after conversion.
$ cd aml_npu_sdk/acuity-toolkit/python $ ls outputs/inception/ inception.nb libnn_inception.so