I followed the steps in this tutorial to convert a trained TensorFlow model generated using Python. Now I want to use that to re-create the model in TensorFlow JS. I passed the path for model.js like this:
const model = tf.loadLayersModel(pathToModelsDotJSON).then(() => {
// Do stuff
})
I'm using Vue.js and when I run the code it throws this error:
Uncaught (in promise) Error: The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.
at new t (tf-layers.esm.js?271e:17)
at t.add (tf-layers.esm.js?271e:17)
at t.fromConfig (tf-layers.esm.js?271e:17)
at deserializeKerasObject (tf-layers.esm.js?271e:17)
at deserialize (tf-layers.esm.js?271e:17)
at eval (tf-layers.esm.js?271e:17)
at eval (tf-layers.esm.js?271e:17)
at Object.eval [as next] (tf-layers.esm.js?271e:17)
at o (tf-layers.esm.js?271e:17)
My question is: Why is this happening? And how to solve it?
loadLayersModel()?