Open maxgerhardt opened 4 months ago
Note: Manually fixing input and output quantization with values read from the model and https://netron.app/ still leads to wrong model output.
int8_t x_quantized = x * 40.69345526012819f + 128;
//..
float y = (y_quantized - 4) * 0.008472034707665443f;
There must be something wrong when TFlite or Flatbuf decodes the model...
Quantized x: 12 input zero point 1073421424 scale -nan
Quantized y: 16 output zero point 1073421408 scale 0.000000
x_value: 3.455752, y_value: 0.101664
Quantized x: 25 input zero point 1073421424 scale -nan
Quantized y: 16 output zero point 1073421408 scale 0.000000
x_value: 3.769912, y_value: 0.101664
Also, updating the platform to use ESP-IDF 5.1.4 did not help, it's the same output pretty much.
Hi @maxgerhardt did you try the example from esp-tflite-micro
without Arduino? https://github.com/espressif/esp-tflite-micro/tree/master/examples/hello_world
Do you find results with this problematic too?
I am having the same issue when testing out the provided hello word example. I am also using PlatformIO with espidf framework (no arduino). I am wondering if this is an issue with the tflite micro interpreter or the model itself?
Running ESP-IDF 4.x + Arduino-ESP32 2.x and trying the hello-world example, the output is wrong. It seems the interpreter loads the model but then
interpreter->input(0);
andinterpreter->output(0);
returns vectors that have an extremely high zero-point and a scale of either 0 or-nan
. This ofc makes the quantized x & y values wrong, too. Specifically, the outputy
is always 0.This is running on a regular ESP32 dev board with no PSRAM. Example projects see https://github.com/maxgerhardt/pio-esp32-tfmicro-example, it uses PlatformIO for compilation. Any help is appreciated.