Issue "promises" creating a model P5.js and Tensorflow.js

How are you?
I am trying to fit a model to predict 3 vectors (x, y coordinates) when I show them 28x28px image tensors.
I’m also doing it in P5.js because I want it to work in the browser.
The thing is that I have some problems with the promises because they are never displayed in the console.

Is the function really working?

This is the link

Any comments about it will be welcome!
See you


currently getting a type mismatch from tensorflow? (is that related?)


Hi Julian,
I made the code again.

This time, the dimensions of the input are correct, but never show me the loss.

Its the same promise problem?

Thanks for your help


Also I realize that Async and await are not working in the sketch.