I am building an npm package that loads a pretrained tensorflow model and makes some prediction.
When i do tf.loadLayersModel()
with tf = require('@tensorflow/tfjs-node')
i have no problem. Unfortunately, that library seem problematic upon installation.
I tried using instead tf = require('@tensorflow/tfjs)
. Although, i get the following error:
UnhandledPromiseRejectionWarning: Error: browserHTTPRequest is not supported outside the web browser without a fetch polyfill.
This is my code:
// Load ML model
tf.loadLayersModel("file://" + __dirname + "mymodel/model.json").then(
model => {
}
}
);
Is there a way i can work this around?.