eloquentarduino / EloquentTinyML

Eloquent interface to Tensorflow Lite for Microcontrollers
301 stars 57 forks source link

'Eloquent' does not name a type #45

Closed hanyc93 closed 2 years ago

hanyc93 commented 2 years ago

I install the library via: Arduino IDE > Tools > Manage Libraries Board: ESP32 Dev Module

Error when compile:

SineExample:11:1: error: 'Eloquent' does not name a type Eloquent::TinyML::TfLite<NUMBER_OF_INPUTS, NUMBER_OF_OUTPUTS, TENSOR_ARENA_SIZE> ml; ^ C:\Users\ADMINI~1\AppData\Local\Temp\arduino_modified_sketch_199840\SineExample.ino: In function 'void setup()': SineExample:16:5: error: 'ml' was not declared in this scope ml.begin(sine_model); ^ C:\Users\ADMINI~1\AppData\Local\Temp\arduino_modified_sketch_199840\SineExample.ino: In function 'void loop()': SineExample:25:27: error: 'ml' was not declared in this scope float predicted = ml.predict(input); ^ exit status 1 'Eloquent' does not name a type

SAOKIM99 commented 2 years ago

try using version 0.5. I also got this error and reverted to an older version to be able to run

eloquentarduino commented 2 years ago

This is due to a breaking change in the API. Install version 2.4.3 then

#include <EloquentTinyML.h>
#include <eloquent_tinyml/tensorflow.h>

Eloquent::TinyML::TensorFlow::TensorFlow<N_INPUTS, N_OUTPUTS, TENSOR_ARENA_SIZE> tf;
ghost commented 1 year ago

This is due to a breaking change in the API. Install version 2.4.3 then

#include <EloquentTinyML.h>
#include <eloquent_tinyml/tensorflow.h>

Eloquent::TinyML::TensorFlow::TensorFlow<N_INPUTS, N_OUTPUTS, TENSOR_ARENA_SIZE> tf;

Solved cool!