This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:vim3:npu:ksnn:ksnn-convert [2023/09/16 07:20] sravan [Conversion example] |
products:sbc:vim3:npu:ksnn:ksnn-convert [2025/09/14 23:42] (current) nick |
||
---|---|---|---|
Line 5: | Line 5: | ||
===== Get the conversion tool ===== | ===== Get the conversion tool ===== | ||
- | The conversion tool is integrated in the NPU SDK. | + | The conversion tool is integrated in the NPU SDK. You can download it from [[dl> |
```shell | ```shell | ||
- | $ git clone --recursive | + | $ wget https://dl.khadas.com/products/ |
+ | $ tar xvzf aml_npu_sdk-ddk-6.4.8.7-250427.tgz | ||
+ | $ ln -fs aml_npu_sdk-ddk-6.4.8.7-250427 aml_npu_sdk | ||
``` | ``` | ||
+ | |||
The KSNN conversion tool is under '' | The KSNN conversion tool is under '' | ||
Line 19: | Line 22: | ||
===== Conversion example ===== | ===== Conversion example ===== | ||
- | Choose tensorflow | + | Choose tensorflow |
1. Get the frozen model, | 1. Get the frozen model, | ||
Line 25: | Line 28: | ||
```shell | ```shell | ||
$ cd aml_npu_sdk/ | $ cd aml_npu_sdk/ | ||
- | $ wget https:// | + | $ wget https:// |
``` | ``` | ||
Line 31: | Line 34: | ||
```shell | ```shell | ||
- | $ ./convert --model-name | + | # uint8 |
- | > --platform tensorflow \ | + | $ ./convert --model-name |
- | > --model /home/yan/yan/Yan/models-zoo/tensorflow/inception/inception_v3_2016_08_28_frozen.pb \ | + | |
- | > --input-size-list '299,299,3' \ | + | |
- | > --inputs | + | |
- | > --outputs | + | |
- | > --mean-values '128 128 128 0.0078125' \ | + | --outputs "' |
- | > --quantized-dtype | + | |
- | > --source-files ./ | + | |
- | > --kboard VIM3 --print-level 0 | + | |
+ | | ||
+ | |||
+ | # int8 | ||
+ | $ ./convert --model-name mobilenet_ssd \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | # int16 | ||
+ | $ ./convert --model-name mobilenet_ssd \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
``` | ``` | ||
Line 49: | Line 79: | ||
```shell | ```shell | ||
$ cd aml_npu_sdk/ | $ cd aml_npu_sdk/ | ||
- | $ ls outputs/inception/ | + | $ ls outputs/mobilenet_ssd/ |
- | inception.nb | + | mobilenet_ssd.nb |
``` | ``` | ||