When I load a saved model like this (please dont mind the fact that the predict function has no input)
const tf = require('@tensorflow/tfjs');
require('@tensorflow/tfjs-node');
const model = tf.loadModel('file://./model-1a/model.json').then(() => {
model.predict();
});
I get this error:
(node:25887) UnhandledPromiseRejectionWarning: TypeError: model.predict is not a function at tf.loadModel.then (/home/ubuntu/workspace/server.js:10:9) at
But when I just create a model instead of loading it works just fine
const model = tf.sequential();
model.add(tf.layers.dense({units: 10, inputShape: [10005]}));
model.add(tf.layers.dense({units: 1, activation: 'linear'}));
model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});
The model predict function works just fine? I don't know what could be wrong here and I was hopeing someone could help me out.