I'm trying to load a model using tf.loadLayersModel('path'); from Tensorflow js and I have too many problems loading the model.
I've trained my model in python. And converted the format from keras to tfjs_layers_model using:
!pip install tensorflowjs
!tensorflowjs_converter --input_format=keras --output_format=tfjs_layers_model model/my_model.h5 model
This way I can convert my model from h5 to JSON, so I can load it in javascript.
The problem is that when I try to load the model the following error outputs:
Error

Initially, I had the same problem but with 'Functional' and I searched for similar errors. Swapping the word Functional for the word Model, this error can be avoided. But a new error (screenshot above) shows.
Maybe I'm misunderstanding something. I think it may have something to do with the conversion. If not, anyone knows how can I fix this new error? Maybe in a similar way as the 'Functional' error?