This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:vim4:npu:npu-sdk [2023/06/06 06:24] nick |
products:sbc:vim4:npu:npu-sdk [2025/05/08 03:08] (current) nick |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== VIM4 NPU SDK Usage ====== | + | ~~tag> |
| + | |||
| + | **Doc for version ddk-3.4.7.7** | ||
| + | |||
| + | ====== VIM4 NPU Model Convert | ||
| + | |||
| + | {{indexmenu_n> | ||
| <WRAP important > | <WRAP important > | ||
| - | Only **New VIM4** supports NPU, you can check the version of your VIM4 here: [[products: | + | Only **New VIM4** supports NPU, you can [[../configurations/identify-version|check VIM4 the version]] |
| </ | </ | ||
| Line 9: | Line 15: | ||
| </ | </ | ||
| - | ===== Install | + | ===== Build Docker |
| - | Follow Docker official docs to install: [[https:// | + | Follow Docker official docs to install |
| - | ===== Get SDK ===== | + | Follow the script below to get Docker image: |
| ```shell | ```shell | ||
| - | $ git clone https:// | + | docker pull numbqq/npu-vim4 |
| - | $ cd vim4_npu_sdk & ls | + | |
| - | bin demo docs README.md | + | |
| ``` | ``` | ||
| - | * docs: SDK documentation. | + | ===== Get Convert Tool ===== |
| - | * bin: All compilation tools required for model conversion. | + | |
| - | * demo: Conversion examples for different platforms. | + | |
| + | You can find the SDK here: [[dl> | ||
| - | ===== Run in Docker ===== | + | ```shell |
| + | $ wget https:// | ||
| + | $ tar xvzf vim4_npu_sdk-ddk-3.4.7.7-250508.tgz | ||
| + | $ cd vim4_npu_sdk-ddk-3.4.7.7-250508 | ||
| + | $ ls | ||
| + | adla-toolkit-binary | ||
| + | ``` | ||
| - | Get Docker: | + | * '' |
| + | * '' | ||
| + | * '' | ||
| - | ```shell | + | <WRAP important> |
| - | $ cd vim4_npu_sdk | + | If your kernel is older than 241129, please use branch |
| - | $ docker pull yanwyb/npu:v1 | + | </WRAP> |
| - | $ docker run -it --name vim4-npu1 -v $(pwd):/ | + | |
| - | -v /etc/ | + | |
| - | -v / | + | |
| - | yanwyb/ | + | |
| - | ``` | + | ===== Convert Model ===== |
| - | Convert the model in docker: | + | Convert the demo model in docker: |
| ```shell | ```shell | ||
| - | khadas@2655b6cbbc01: | + | bash convert-in-docker.sh normal |
| - | khadas@2655b6cbbc01: | + | |
| ``` | ``` | ||
| - | Each platform | + | If everything works well you will find the converted files below. |
| ```shell | ```shell | ||
| - | khadas@2655b6cbbc01: | + | ~/vim4_npu_sdk$ ls adla-toolkit-binary/ |
| caffe_output | caffe_output | ||
| convert_adla.sh | convert_adla.sh | ||
| ``` | ``` | ||
| + | |||
| + | Converted model is '' | ||
| + | |||
| + | <WRAP tip > | ||
| + | If you want to convert your own model, just modify script '' | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Important parameters ==== | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * Out1 = (data1-m1)/ | ||
| + | * Out2 = (data2-m2)/ | ||
| + | * Out3 = (data3-m3)/ | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ===== See Also ===== | ||
| + | |||
| + | For more information, | ||
| + | |||