This folder contains an example of how to use TVM to run a model on bare metal Cortex(R)-M55 CPU and CMSIS-NN.
If the demo is run in the ci_cpu Docker container provided with TVM, then the following software will already be installed.
If the demo is not run in the ci_cpu Docker container, then you will need the following:
pip install -r ./requirements.txt
You will also need TVM which can either be:
You will need to update your PATH environment variable to include the path to cmake 3.19.5 and the FVP. For example if you've installed these in /opt/arm
, then you would do the following:
export PATH=/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4:/opt/arm/cmake/bin:$PATH
Type the following command to run the bare metal demo application (src/demo_bare_metal.c):
./run_demo.sh
If the Ethos(TM)-U platform and/or CMSIS have not been installed in /opt/arm/ethosu then the locations for these can be specified as arguments to run_demo.sh, for example:
./run_demo.sh --cmsis_path /home/tvm-user/cmsis \ --ethosu_platform_path /home/tvm-user/ethosu/core_platform
This will:
The create_image.py script takes a single argument on the command line which is the path of the image to be converted into an array of bytes for consumption by the model.
The demo can be modified to use an image of your choice by changing the following line in run_demo.sh
curl -sS https://raw.githubusercontent.com/tensorflow/tflite-micro/main/tensorflow/lite/micro/examples/person_detection/testdata/person.bmp -o input_image.bmp