Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools



Edge2 TFLite Delegate

Khadas Edges and VIMs are powered by ARM Cortex-A CPUs and Mali GPUs.

We can make use of the available computation power for running TFLite models using ArmNN Libraries by leveraging TFLite interpreter Delegate.

The Delegate is provided by ARM as arm-software/armnn and the provided examples are made to make use of it.

This library depends on OpenCL, make sure you are using the following platforms to ensure the driver is present.

board Linux Kernel (BSP) OS
VIM3 4.9
Ubuntu 22.04
VIM3L 4.9
Ubuntu 22.04
VIM4 5.4
Ubuntu 22.04
Edge2 5.10 Ubuntu 22.04

You can refer to the OpenCL doc for more info.

Get source code

Clone the examples sravansenthiln1/armnn_tflite

$ git clone
$ cd armnn_tflite

Setup the environment

Install pip

$ sudo apt-get install python3-pip

Install necessary python packages

$ pip3 install numpy pillow

Install the TFLite runtime interpreter

$ pip3 install --extra-index-url tflite_runtime

Download ArmNN libraries

$ wget -O ArmNN-aarch64.tgz
$ mkdir libs
$ tar -xvf ArmNN-aarch64.tgz -C libs

Run Examples

Taking the Mobilenet v1 as example.

Enter the example directory

$ cd mobilenet_v1
$ sudo ln ../libs/
$ sudo ln ../libs/

Run the example

$ python3

You can modify whether you want to use the CPU or GPU to accelerate the inference. Change the BACKEND variable in the code to use either GpuAcc - GPU or CpuAcc - CPU backends.

2023/10/23 02:52 · sravan
Last modified: 2023/10/23 02:59 by sravan