eloquentarduino / EloquentTinyML

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

print multiple outputs #9

Closed coolcodecding closed 3 years ago

coolcodecding commented 3 years ago

Could you put an example in the README of how to deal with multiple outputs?

I have a model with 2 outputs (softmax) and changed the following lines in the code:

#define NUMBER_OF_OUTPUTS 2

float output[2] = {};
float predicted = ml.predict(input, output);

and Serial.println(predicted[1]); as I want to get the second output.

I get the following error:

error: invalid types 'float[int]' for array subscript
     Serial.println(predicted[1]);
                               ^

Thanks!

eloquentarduino commented 3 years ago

I will do it

eloquentarduino commented 3 years ago

Sorry to have not replied earlier, I totally forgot this issue. Try to print output[1]

eloquentarduino commented 3 years ago

See #10