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/07 01:47] louis |
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 Docker: [[https:// | Follow Docker official docs to install Docker: [[https:// | ||
| - | ===== Get NPU 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 documentations | + | ===== Get Convert Tool ===== |
| - | * bin: SDK tools required for model conversion | + | |
| - | * demo: Conversion examples | + | |
| - | ===== Convert model in Docker ===== | + | You can find the SDK here: [[dl> |
| - | + | ||
| - | Get Docker: | + | |
| ```shell | ```shell | ||
| - | $ cd vim4_npu_sdk | + | $ wget https:// |
| - | $ docker pull yanwyb/npu:v1 | + | $ tar xvzf vim4_npu_sdk-ddk-3.4.7.7-250508.tgz |
| - | $ docker run -it --name vim4-npu1 -v $(pwd):/ | + | $ cd vim4_npu_sdk-ddk-3.4.7.7-250508 |
| - | -v / | + | $ ls |
| - | -v / | + | adla-toolkit-binary |
| - | yanwyb/ | + | |
| ``` | ``` | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | <WRAP important> | ||
| + | If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5. | ||
| + | </ | ||
| + | |||
| + | ===== Convert Model ===== | ||
| Convert the demo model in docker: | Convert the demo model in docker: | ||
| ```shell | ```shell | ||
| - | khadas@2655b6cbbc01: | + | bash convert-in-docker.sh normal |
| - | khadas@2655b6cbbc01: | + | |
| ``` | ``` | ||
| - | If everything works well you will find the converted files below: | + | 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 | ||
| ``` | ``` | ||
| - | ===== Parameter ===== | + | Converted model is '' |
| - | | + | <WRAP tip > |
| - | | + | If you want to convert your own model, just modify script '' |
| - | | + | </ |
| - | | + | |
| - | | + | |
| - | | + | ==== Important parameters ==== |
| - | - '' | + | |
| - | | + | * '' |
| - | | + | |
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | * '' | ||
| + | | ||
| * Out1 = (data1-m1)/ | * Out1 = (data1-m1)/ | ||
| * Out2 = (data2-m2)/ | * Out2 = (data2-m2)/ | ||
| * Out3 = (data3-m3)/ | * Out3 = (data3-m3)/ | ||
| - | | + | |
| - | | + | * '' |
| - | | + | |
| - | * There are currently three valid values: PRODUCT_PID0XA001、PRODUCT_PID0XA002 and PRODUCT_PID0XA003. | + | |
| - | * You can use the following command to confirm the value that should be set.Execute: | + | |
| - | ```shell | + | |
| - | khadas@Khadas: | + | |
| - | ``` | + | |
| - | * View the first four characters of the sequence code corresponding to Serial in the second last line (the part in bold after Serial). Serial number and parameters PRODUCT_PID0X? | + | |
| - | + | ||
| - | {{: | + | |
| ===== See Also ===== | ===== See Also ===== | ||
| For more information, | For more information, | ||
| + | |||