Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:npu:demos:densenet

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
products:sbc:vim4:npu:demos:densenet [2024/12/03 02:10]
louis
products:sbc:vim4:npu:demos:densenet [2025/01/08 22:22] (current)
louis
Line 28: Line 28:
 ==== Get the conversion tool ==== ==== Get the conversion tool ====
  
-Download The conversion tool from [[gl>khadas/vim4_npu_sdk]].+Download The conversion tool from [[gh>khadas/vim4_npu_sdk]].
  
 ```shell ```shell
-$ git clone https://gitlab.com/khadas/vim4_npu_sdk +$ git clone https://github.com/khadas/vim4_npu_sdk
-``` +
- +
-```shell +
-$ git lfs install +
-$ git lfs clone https://gitlab.com/khadas/vim4_npu_sdk.git+
 $ cd vim4_npu_sdk $ cd vim4_npu_sdk
 +$ git lfs pull
 $ ls $ ls
 adla-toolkit-binary  adla-toolkit-binary-3.1.7.4  convert-in-docker.sh  Dockerfile  docs  README.md adla-toolkit-binary  adla-toolkit-binary-3.1.7.4  convert-in-docker.sh  Dockerfile  docs  README.md
Line 47: Line 43:
  
 <WRAP important> <WRAP important>
-If your kernel is older than 241129, please use version before tag ddk-3.4.7.7.+If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5
 </WRAP> </WRAP>
  
Line 79: Line 75:
 ``` ```
  
-Enter ''vim4_npu_sdk/demo'' and modify ''convert_adla.sh'' as follows. We should quantize the model to **int16** because it is very inaccurate with **int8**.+Enter ''vim4_npu_sdk/demo'' and modify ''convert_adla.sh'' as follows.
  
 ```bash convert_adla.sh ```bash convert_adla.sh
Line 100: Line 96:
         --inference-input-type float32 \         --inference-input-type float32 \
  --inference-output-type float32 \  --inference-output-type float32 \
-        --quantize-dtype int16 --outdir onnx_output  \+        --quantize-dtype int8 --outdir onnx_output  \
         --channel-mean-value "0,0,0,255"  \         --channel-mean-value "0,0,0,255"  \
         --source-file ./densenet_ctc_dataset.txt  \         --source-file ./densenet_ctc_dataset.txt  \
Line 139: Line 135:
 === Picture input demo === === Picture input demo ===
  
-Put ''densenet_ctc_int16.adla'' in ''vim4_npu_applications/densenet_ctc/data/''.+Put ''densenet_ctc_int8.adla'' in ''vim4_npu_applications/densenet_ctc/data/''.
  
 ```shell ```shell
Line 150: Line 146:
  
 # Run # Run
-$ ./densenet_ctc -m ../data/densenet_ctc_int16.adla -p ../data/KhadasTeam.png+$ ./densenet_ctc -m ../data/densenet_ctc_int8.adla -p ../data/KhadasTeam.png
 ``` ```
  
Last modified: 2024/12/03 02:10 by louis