Closed FerenczD closed 3 years ago
Looking at your wrapper code I don't see anything that stands out immediately. Can you share the Collab notebook where you train the Keras model?
Also, how are you running the model? Before running on hardware I typically try to run on my host machine using:
make -f tensorflow/lite/micro/tools/make/Makefile TARGET=posix test_
Running on the host can help speed up development and isolate platform-specific issues.
@njeffrie , any update on this issue, @FerenczD did you manage to fix it?
@njeffrie @eliethesaiyan I apologize forgot this issue was still open. I did solve the problem. It was coming from the creation of my model.
Originally I had 4 layers - 1 input, 1 output and 2 hidden layers with 32 and 20 nodes. Values for the hidden layers were picked randomly, to be honest.
However, I changed the nodes of the hidden layer to be 16 and 8 for some reason it started to work on the ESP32 side.
@tensorflow/micro
System information
My goal is to run a Keras model I have made in my ESP32 microcontroller. I have the libraries all working correctly.
I have created a Keras model using google Collab that looks to be working fine when I give it random test data within google Collab. The model has two input features and 4 different outputs.(a multiple-output regression model)
However, when I export and load the model into my c++ application in the ESP32 it does not matter what the inputs are, it always predicts the same output.
I have based myself in this code in order to load and run the model in c++ : https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/examples/magic_wand/main_functions.cc
And this is my version of the code
The model seems to load ok as the dimensions and sizes are correct. But the output is always the same 4 values. The input are float32
Any idea on what can be going wrong? Is it something about my model or am I just not using the model correctly in my c++ application?