BrainChip AKD1000

The AKD1000-powered PCIe boards can be plugged into a developer’s existing linux system to unlock capabilities for a wide array of edge AI applications, including Smart City, Smart Health, Smart Home and Smart Transportation. Linux machines with the AKD1000 are supported by Edge Impulse so that you can sample raw data, build models, and deploy trained embedded machine learning models directly from the Edge Impulse studio to create the next generation of low-power, high-performance ML applications.

To learn more about BrainChip technology please visit BrainChip's website: https://brainchip.com/products/

Akida™ PCIe

Installing dependencies

To enable this device for Edge Impulse deployments you must install the following dependencies on your Linux target that has an Akida PCIe board attached.

Connecting to Edge Impulse

With all software set up, connect your camera or microphone to your operating system and run:

$ edge-impulse-linux

This will start a wizard which will ask you to log in, and choose an Edge Impulse project. If you want to switch projects run the command with --clean.

Verifying that your device is connected

That's all! Your machine is now connected to Edge Impulse. To verify this, go to your Edge Impulse project, and click Devices. The device will be listed here.

Device connected to Edge Impulse.

Design an Impulse with BrainChip Akida™ Learning Blocks

After adding data via Data acquisition starting an Impulse Design you can add BrainChip Akida™ Learning Block. The type of Learning Blocks visible depend on the type of data collected. Using BrainChip Akida™ Learning Blocks will ensure that models generated for deployment will be compatible with BrainChip Akida™ devices.

Akida™ Learning Block

Training a BrainChip Akida™ Compatible Model

In the Learning Block of the Impulse Design one can compare between Float, Quantized, and Akida™ versions of a model. If you added a Processing Block to your Impulse Design you will need to generate features before you can train your model. If the project uses a transfer learning block you may be able to select a base model from BrainChip’s Model zoo to transfer learn from. More models will be available in the future, but if you have a specific request please let us know via the Edge Impulse forums.

Akidanet Models

Deploying back to device

In order to achieve full hardware acceleration models must be converted from their original format to run on an AKD1000. This can be done by selecting the BrainChip MetaTF Block from the Deployment Screen. This will generate a .zip file with models that can be used in your application for the AKD1000. The block uses the CNN2SNN toolkit to convert quantized models to SNN models compatible for the AKD1000. One can then develop an application using the Akida™ python package that will call the Akida™ formatted model found inside the .zip file.

BrainChip MetaTF Deployment Block

BrainChip MetaTF Deployment Block

Alternatively, you can use the AKD1000 Block to generate a pre-built binary that can be used by the Edge Impulse Linux CLI to run on your Linux installation with a AKD1000 Mini PCIe present.

AKD1000 Deployment Block

AKD1000 Deployment Block

The output from this Block is an .eim file that, one saved, can be run with the following command:

edge-impulse-linux-runner --model-file <path-to-model.eim>

Public Projects using Akida™ Learning Blocks

We have multiple projects that are available to clone immediately to quickly train and deploy models for the AKD1000.

Image model?

If you have an image model then you can get a peek of what your device sees by being on the same network as your device, and finding the 'Want to see a feed of the camera and live classification in your browser' message in the console. Open the URL in a browser and both the camera feed and the classification are shown:

Live feed with classification results

Troubleshooting

Error: Classifying failed, error code was -23 (missing Python akida library)

It is mainly related to initialization of the Akida™ NSoC and model and is could be caused by lack of Akida Python libraries. Please check if you have an Akida™ Python library installed:

$ pip show akida

Example output:

Name: akida
Version: 2.2.2
Summary: Akida Execution Engine
Home-page: https://doc.brainchipinc.com
Author: David Corvoysier
Author-email: dcorvoysier@brainchip.com
License: Proprietary
Location: /home/user/.local/lib/python3.8/site-packages
Requires: numpy
Required-by: cnn2snn

If you don't have the library (WARNING: Package(s) not found: akida) then install it:

$ pip install akida==2.2.2

If you have the library, then check if the EIM artifact is looking for the library in the correct place. First, download your EIM model using Edge Impulse Linux CLI tools:

$ edge-impulse-linux-runner --download model.eim

Then run the EIM model with debug option:

$ chmod +x model.eim
$ ./model.eim
DEBUG: sys.path:
	/usr/lib64/python38.zip
	/usr/lib64/python3.8
	/usr/lib64/python3.8/lib-dynload
	/usr/lib64/python3.8/site-packages
	/usr/lib/python3.8/site-packages

Now check if your Location directory from pip show akida command is listed in your sys.path output. If not (usually it happens if you are using Python virtual environments), then export PYTHONPATH:

$ export PYTHONPATH=/home/user/.local/lib/python3.8/site-packages

And try to run the model with edge-impulse-linux-runner once again.

Error: Classifying failed, error code was -23 (other issues)

If the previous step didn't help, try to get additional debug data. With your EIM model downloaded, open one terminal window and do:

$ ./model.eim /tmp/ei.socket

Then in another terminal:

$ edge-impulse-linux-runner --model-file /tmp/ei.socket

This should give you additional info in the first terminal about the possible root of your issue.

Failed to run impulse Capture process failed with code 1

This error could mean that your camera is in use by another process. Check if you don't have any application open that is using the camera. This error could all exists when your previous attempt to run edge-impulse-linux-runner failed with exception. In that case, check if you have a gst-launch-1.0 process running. For example:

$ ps aux | grep gst-launch-1.0
   5615 pts/0    00:01:52 gst-launch-1.0

In this case, the first number (here 5615) is a process ID. Kill the process:

$ kill -9 5615

And try to run the model with edge-impulse-linux-runner once again.

Last updated

Revision created on 1/3/2023