Setting up Axon
This page outlines the requirements that you need to fulfill before you start working with the Axon NPU using Axon API directly, without the abstraction layer of nRF Edge AI Library API.
Hardware requirements
Axon NPU library is included as part of the nRF Edge AI Library and provided as compiled binaries for Cortex-M33F architectures. Axon NPU is currently available on the nRF54LM20B device.
Software requirements
To start working with the Axon NPU, complete the setup based on your use case:
If you want to deploy models on the device, you just need to complete Setting up the SDK to install nRF Connect SDK, toolchain, and nRF Edge AI Library.
If you want to prepare models for deployment, you only need to set up a Python environment to run the Axon NPU TFLITE compiler. Follow instructions in Setting up Axon TFlite Compiler to set up the environment.
Setting up Axon TFlite Compiler
Before you can run the Axon NPU TFLITE compiler, you need to set up a Python environment with the required dependencies.
The executor of the compiler is compatible with Python 3.11.
You can set up the Python environment using one of the methods below.
Using a virtual environment is strongly recommended to isolate dependencies. You can use any virtual environment tool you prefer. This section shows one example using Miniforge (Conda):
Install Miniforge
Ensure the Conda
scriptsdirectory is added to your systemPATH, for example,C:/Users/<user>/AppData/Local/miniforge3/Scripts.Create a new environment with the supported Python version:
conda create -n <env_name> python=3.11Activate the environment. All installation and execution commands must be run from the activated environment:
conda activate <env_name>Install the required Python packages using the
requirements.txtfile:cd tools/axon/compiler/scripts pip install -r requirements.txt
Note
On macOS, you may encounter the ERROR: No matching distribution found for tensorflow==2.15.1 error.
To fix it, install TensorFlow using Conda instead:
conda install -c conda-forge tensorflow=2.15.1
Once you complete the setup, you can try running the compiler by following instructions in Axon NPU TFLITE compiler.
Docker provides a fully isolated way to run the compiler without installing dependencies locally.
Before using Docker with the compiler, you must install it on the system. You should also verify that Docker is working correctly by building and running a simple Docker container.
The following links provide introductory material and best-practice guidance for Docker:
Once you have installed and verified Docker, you can follow Using Docker (Optional) to build and run a Docker container for the Python compiler executor.
Podman is a daemonless alternative to Docker. Follow the steps below to set up Podman and run the compiler in a Podman container:
Install Podman by following the Podman installation guide.
Set up and run a simple container with Podman
Once you have installed and verified Podman, you can follow Alternative to Docker: Podman to build and run a Podman container for the Python compiler executor.