Load Tensorflow js model from local file system in javascript

I know you’re trying to load your model in a browser but if anybody lands here that’s trying to do it in Node, here’s how:

const tf = require("@tensorflow/tfjs");
const tfn = require("@tensorflow/tfjs-node");
const handler = tfn.io.fileSystem("./path/to/your/model.json");
const model = await tf.loadLayersModel(handler);

Leave a Comment