Inferencing SDK Error Codes

In case things do not go as expected, inferencing SDK returns a pre-specified error code, that can give a developer an idea of what went wrong during code execution.
These error codes can be divided into two kinds:

  • generic Edge Impulse SDK errors
  • DSP code specific errors

Generic Edge Impulse SDK Errors

Source code: edge-impulse-sdk/porting/ei_classifier_porting.h

EI_IMPULSE_OK = 0

Successful code execution.

EI_IMPULSE_ERROR_SHAPES_DONT_MATCH = -1

The shape of data does not match the shape of input layer.

EI_IMPULSE_CANCELED = -2

Impulse execution is cancelled by user.

EI_IMPULSE_TFLITE_ERROR = -3

Generic TFlite inference engine error.

EI_IMPULSE_DSP_ERROR = -5

Generic DSP component error.

EI_IMPULSE_TFLITE_ARENA_ALLOC_FAILED = -6

Tensor arena allocation failed, often caused by lack of heap memory or its fragmentation.
In the case of lack of heap memory you may want to allocate the tensor arena statically by defining "EI_CLASSIFIER_ALLOCATION_STATIC=1" when building your project.
If the problem still persists, then it may be that there's not enough RAM/heap for your model and this application.

EI_IMPULSE_CUBEAI_ERROR = -7

Generic CubeAI inference engine error.

EI_IMPULSE_ALLOC_FAILED = -8

Allocation failed. This might be caused by fragmentation of the heap.
Try to increase the heap size and see if that solves the issue.

EI_IMPULSE_ONLY_SUPPORTED_FOR_IMAGES = -9

This function is only supported for impulses with an image input.

EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE = -10

The selected inference engine (chosen on Deployment step in Studio) is incapable of running this impulse.

EI_IMPULSE_OUT_OF_MEMORY = -11

Out of memory. This might be caused by fragmentation of the heap.
Try to increase the heap size or optimize it's usage and see if that solves the issue.

EI_IMPULSE_INPUT_TENSOR_WAS_NULL = -13

Input tensor is null.

EI_IMPULSE_OUTPUT_TENSOR_WAS_NULL = -14

Output tensor is null.

EI_IMPULSE_SCORE_TENSOR_WAS_NULL = -15

Score tensor is null (for SSD Object Detection models).

EI_IMPULSE_LABEL_TENSOR_WAS_NULL = -16

Label tensor is null (for SSD Object Detection models)..

EI_IMPULSE_TENSORRT_INIT_FAILED = -17

TensorRT initialization failed.

EI_IMPULSE_DRPAI_INIT_FAILED = -18

DRPAI initialization failed.

EI_IMPULSE_DRPAI_RUNTIME_FAILED = -19

DRPAI runtime error.

EI_IMPULSE_DEPRECATED_MODEL = -20

This model is deprecated.
You should re-export the impulse from Studio.

DSP Code Specific Errors

Source code: edge-impulse-sdk/dsp/returntypes.hpp

EIDSP_OK = 0

Successful code execution.

EIDSP_OUT_OF_MEM = -1002

Out of memory, this is most likely caused by your platform running out of heap memory.

EIDSP_SIGNAL_SIZE_MISMATCH = -1003

Signal size mismatch, the signal that was passed to the DSP library was not the expected size.
Should only happen if you have modified the SDK. Otherwise, please report bug to EI.

EIDSP_MATRIX_SIZE_MISMATCH = -1004

Matrix size mismatch, the matrix that was passed to the DSP library was not the expected size.
Should only happen if you have modified the SDK. Otherwise, please report bug to EI.

EIDSP_DCT_ERROR = -1005

DCT error.
Should only happen if you have modified the SDK. Otherwise, please report bug to EI.

EIDSP_INPUT_MATRIX_EMPTY = -1006

Input matrix is empty, this is most likely caused by a signal buffer that was not filled.

EIDSP_BUFFER_SIZE_MISMATCH = -1007

Buffer size mismatch, the buffer passed to the rfft function was not the expected size.

EIDSP_PARAMETER_INVALID = -1008

Parameter invalid.
Should only happen if you have modified the SDK. Otherwise, please report bug to EI.

EIDSP_UNEXPECTED_NEXT_OFFSET = -1009

Unexpected next offset. Unused

EIDSP_OUT_OF_BOUNDS = -1010

Out of bounds. Unused

EIDSP_UNSUPPORTED_FILTER_CONFIG = -1011

Unsupported filter config. Unused

EIDSP_NARROWING = -1012

Error in using dot product function.
Should only happen if you have modified the SDK. Otherwise, please report bug to EI.

EIDSP_BLOCK_VERSION_INCORRECT = -1013

Block version incorrect.
This may happen if you have only partially updated your export.
For example, if you only copy in the model folder and not edge-impulse-sdk from the zip file generated by Studio.

EIDSP_NOT_SUPPORTED = -1014

This occurs if you are using EI_C_LINKAGE to call to SDK from a C file.
Some functions are not supported via C linkage.

EIDSP_REQUIRES_CMSIS_DSP = -1015

Requires CMSIS DSP.
Please add the macro EIDSP_USE_CMSIS_DSP=1 to your compilation.

EIDSP_FFT_TABLE_NOT_LOADED = -1016

FFT table not loaded.
If you are using a custom DSP block and did not return the array "fft_used" with the sizes of you needed ffts, and you are using CMSIS, please return this array from your custom DSP python block. Or set the macro EIDSP_USE_CMSIS_DSP=0 to use kissFFT instead