Louis or others at EI:
I looked at the source code for my downloaded Arduino Library ZIP, in particular model_metadata.h:
#define EI_CLASSIFIER_SENSOR EI_CLASSIFIER_SENSOR_FUSION
#define EI_CLASSIFIER_FUSION_AXES_STRING “accX + accY + accZ + gyrX + gyrY + gyrZ”
I tried replacing the above 2 lines with:
#define EI_CLASSIFIER_SENSOR EI_CLASSIFIER_SENSOR_ACCELEROMETER
#define EI_CLASSIFIER_FUSION_AXES_STRING “accX + accY + accZ”
but my project in Arduino IDE 1.8.19 now fails to compile with the error message:
In file included from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_model_types.h:28:0,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_dsp.h:26,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:28,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/FanPredictiveMaintenance_inferencing.h:55,
from /Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:24:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/dsp/numpy.hpp: In static member function ‘static int ei::numpy::welch_max_hold(float*, size_t, float*, size_t, size_t, size_t, bool)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/dsp/numpy.hpp:2374:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (input_ix < input_size) {
~^~~~
In file included from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/dsp/spectral/spectral.hpp:28:0,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_dsp.h:27,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:28,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/FanPredictiveMaintenance_inferencing.h:55,
from /Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:24:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/dsp/spectral/feature.hpp: In static member function ‘static int ei::spectral::feature::extract_spectral_analysis_features_v2(ei::matrix_t*, ei::matrix_t*, ei_dsp_config_spectral_analysis_t*, float)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/dsp/spectral/feature.hpp:425:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < data_size; i++) {
^~~~~~~~~
In file included from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h:37:0,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:61,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/FanPredictiveMaintenance_inferencing.h:55,
from /Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:24:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h: In function ‘bool ei_cube_check_overlap(ei_classifier_cube_t*, int, int, int, int, float)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:45:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
bool is_overlapping = !(c->x + c->width < x || c->y + c->height < y || c->x > x + width || c->y > y + height);
^
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:45:69: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
bool is_overlapping = !(c->x + c->width < x || c->y + c->height < y || c->x > x + width || c->y > y + height);
~^
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:45:81: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
bool is_overlapping = !(c->x + c->width < x || c->y + c->height < y || c->x > x + width || c->y > y + height);
~^
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:45:101: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
bool is_overlapping = !(c->x + c->width < x || c->y + c->height < y || c->x > x + width || c->y > y + height);
~^~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:49:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (x < c->x) {
^~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:55:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (y < c->y) {
^~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:61:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (x + width > c->x + c->width) {
^
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:66:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (y + height > c->y + c->height) {
~^~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h: In function ‘void fill_result_struct_from_cubes(ei_impulse_result_t*, std::vector<cube*>, int, uint32_t)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:152:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(added_boxes_count < object_detection_count) {
^~~~~~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h: In function 'void fill_result_struct_f32_fomo(const ei_impulse_t, ei_impulse_result_t*, float*, int, int)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:172:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t y = 0; y < out_width; y++) {
^~~~~~~~~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:174:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t x = 0; x < out_height; x++) {
^~~~~~~~~~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:177:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t ix = 1; ix < impulse->label_count + 1; ix++) {
~^~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h: In function ‘void fill_result_struct_i8_fomo(const ei_impulse_t*, ei_impulse_result_t*, int8_t*, float, float, int, int)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:193:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t y = 0; y < out_width; y++) {
^~~~~~~~~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:195:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t x = 0; x < out_height; x++) {
^~~~~~~~~~
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_fill_result_struct.h:198:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t ix = 1; ix < impulse->label_count + 1; ix++) {
~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/FanPredictiveMaintenance_inferencing.h:55:0,
from /Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:24:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h: In function ‘EI_IMPULSE_ERROR {anonymous}::run_impulse(ei_impulse_result_t*, mbed::Callback<void(float*, unsigned int)>, bool)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:779:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < impulse.dsp_input_frame_size; i += impulse.raw_samples_per_frame) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino: In function ‘void run_inference_background()’:
fan_PM_nano_rp2040_accelerometer_continuous:103:5: error: ‘ei_classifier_smooth_t’ was not declared in this scope
ei_classifier_smooth_t smooth;
^~~~~~~~~~~~~~~~~~~~~~
/Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:103:5: note: suggested alternative: ‘ei_classifier_cube_t’
ei_classifier_smooth_t smooth;
^~~~~~~~~~~~~~~~~~~~~~
ei_classifier_cube_t
fan_PM_nano_rp2040_accelerometer_continuous:104:32: error: ‘smooth’ was not declared in this scope
ei_classifier_smooth_init(&smooth, 10 /* no. of readings /, 7 / min. readings the same /, 0.8 / min. confidence /, 0.3 / max anomaly */);
^~~~~~
/Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:104:32: note: suggested alternative: ‘short’
ei_classifier_smooth_init(&smooth, 10 /* no. of readings /, 7 / min. readings the same /, 0.8 / min. confidence /, 0.3 / max anomaly */);
^~~~~~
short
fan_PM_nano_rp2040_accelerometer_continuous:104:5: error: ‘ei_classifier_smooth_init’ was not declared in this scope
ei_classifier_smooth_init(&smooth, 10 /* no. of readings /, 7 / min. readings the same /, 0.8 / min. confidence /, 0.3 / max anomaly */);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:104:5: note: suggested alternative: ‘ei_classifier_cube_t’
ei_classifier_smooth_init(&smooth, 10 /* no. of readings /, 7 / min. readings the same /, 0.8 / min. confidence /, 0.3 / max anomaly */);
^~~~~~~~~~~~~~~~~~~~~~~~~
ei_classifier_cube_t
fan_PM_nano_rp2040_accelerometer_continuous:134:34: error: ‘ei_classifier_smooth_update’ was not declared in this scope
const char *prediction = ei_classifier_smooth_update(&smooth, &result);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:134:34: note: suggested alternative: ‘ei_classifier_anom_scale’
const char *prediction = ei_classifier_smooth_update(&smooth, &result);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
ei_classifier_anom_scale
fan_PM_nano_rp2040_accelerometer_continuous:152:5: error: ‘ei_classifier_smooth_free’ was not declared in this scope
ei_classifier_smooth_free(&smooth);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:152:5: note: suggested alternative: ‘ei_classifier_anom_mean’
ei_classifier_smooth_free(&smooth);
^~~~~~~~~~~~~~~~~~~~~~~~~
ei_classifier_anom_mean
In file included from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/ei_run_classifier.h:61:0,
from /Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/FanPredictiveMaintenance_inferencing.h:55,
from /Users/jpingel/Documents/Arduino/fan_PM_nano_rp2040_accelerometer_continuous/fan_PM_nano_rp2040_accelerometer_continuous.ino:24:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h: In function ‘EI_IMPULSE_ERROR run_nn_inference(const ei_impulse_t*, ei::matrix_t*, ei_impulse_result_t*, bool)’:
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h:257:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
}
^
/Users/jpingel/Documents/Arduino/libraries/FanPredictiveMaintenance_inferencing/src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h:259:9: note: here
default: {
^~~~~~~
exit status 1
‘ei_classifier_smooth_t’ was not declared in this scope
…
So, … what project settings do I need to correct/change to make this project successfully compile, download and run on my Arduino Nano RP2040 Connect device?
Thanks,
John Pingel