Table of Contents

VIM4 NPU Model Convert

Only New VIM4 supports NPU, you can check VIM4 the version

We provided the Docker container for you to convert the model.

Build Docker Environment

Follow Docker official docs to install Docker: Install Docker Engine on Ubuntu.

Follow the script below to get Docker image:

docker pull numbqq/npu-vim4

Get Convert Tool

$ git lfs install
$ git lfs clone https://gitlab.com/khadas/vim4_npu_sdk.git
$ cd vim4_npu_sdk
$ ls
adla-toolkit-binary  adla-toolkit-binary-1.2.0.9  convert-in-docker.sh  Dockerfile  docs  README.md

Convert Model

Convert the demo model in docker:

bash convert-in-docker.sh normal

If everything works well you will find the converted files below.

~/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
convert_adla.sh  data            keras_output  model_source  onnx_output   pytorch_output  tensorflow_output

Converted model is xxxx.adla.

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.

Important parameters

See Also

For more information, please check docs/model_conversion_user_guide_1.2.pdf.