Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:npu:npu-sdk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
products:sbc:vim4:npu:npu-sdk [2023/09/10 04:13]
hyphop [NPU Model Convert]
products:sbc:vim4:npu:npu-sdk [2024/04/18 04:33]
nick [Get Convert Tool]
Line 1: Line 1:
 +~~tag>VIM4 NPU Docker ~~
  
-~~tag>VIM4 NPU~~ 
 ====== NPU Model Convert ====== ====== NPU Model Convert ======
 +
 +{{indexmenu_n>2}}
  
 <WRAP important > <WRAP important >
-Only **New VIM4** supports NPU, you can check the version of your [[/VIM4]] here: [[products:sbc:vim4:configurations:identify-version|]]+Only **New VIM4** supports NPU, you can [[../configurations/identify-version|check VIM4 the version]]
 </WRAP> </WRAP>
  
Line 11: Line 13:
 </WRAP> </WRAP>
  
-===== Build Virtual Environment =====+===== Build Docker Environment =====
  
 Follow Docker official docs to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]]. Follow Docker official docs to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]].
  
-Get Docker:+Follow the script below to get Docker image:
  
 ```shell ```shell
-docker pull yanwyb/npu:v1 +docker pull numbqq/npu-vim4
-$ docker run -it --name vim4-npu1 -v $(pwd):/home/khadas/npu \ +
- -v /etc/localtime:/etc/localtime:ro \ +
- -v /etc/timezone:/etc/timezone:ro \ +
- yanwyb/npu:v1+
 ``` ```
  
Line 28: Line 26:
  
 ```shell ```shell
-$ git clone https://gitlab.com/khadas/vim4_npu_sdk.git+$ git clone https://gitlab.com/khadas/vim4_npu_sdk.git --depth=1
 $ cd vim4_npu_sdk $ cd vim4_npu_sdk
 $ ls $ ls
-bin  demo  docs  README.md+adla-toolkit-binary  adla-toolkit-binary-1.2.0.9  convert-in-docker.sh  Dockerfile  docs  README.md
 ``` ```
  
-  * ''docs'' - SDK documentations +  * ''adla-toolkit-binary/docs'' - SDK documentations 
-  * ''bin'' - SDK tools required for model conversion +  * ''adla-toolkit-binary/bin'' - SDK tools required for model conversion 
-  * ''demo'' - Conversion examples+  * ''adla-toolkit-binary/demo'' - Conversion examples
  
 ===== Convert Model ===== ===== Convert Model =====
Line 43: Line 41:
  
 ```shell ```shell
-$ khadas@2655b6cbbc01:~/npu$ cd demo/ +./convert-in-docker.sh
-$ khadas@2655b6cbbc01:~/npu/demo$ bash convert_adla.sh+
 ``` ```
  
Line 50: Line 47:
  
 ```shell ```shell
-$ khadas@2655b6cbbc01:~/npu/demo$ ls+~/vim4_npu_sdk$ ls adla-toolkit-binary/demo/
 caffe_output     darknet_output  dataset.txt   libstdc++_so  mxnet_output  paddle_output   quantized_tflite_output  tflite_output caffe_output     darknet_output  dataset.txt   libstdc++_so  mxnet_output  paddle_output   quantized_tflite_output  tflite_output
 convert_adla.sh  data            keras_output  model_source  onnx_output   pytorch_output  tensorflow_output convert_adla.sh  data            keras_output  model_source  onnx_output   pytorch_output  tensorflow_output
Line 56: Line 53:
  
 Converted model is ''xxxx.adla''. Converted model is ''xxxx.adla''.
 +
 +<WRAP tip >
 +If you want to convert your own model, just modify script ''adla-toolkit-binary/demo/convert_adla.sh'' and  then execute ''./convert-in-docker.sh'' to convert your model.
 +</WRAP>
 +
  
 ==== Important parameters ==== ==== Important parameters ====
Last modified: 2024/04/18 04:33 by nick