Saving/loading Models in Tensor Flow

Overview


Saving/Loading Models




await model.save('downloads://my-model');


const model1 = await tf.loadLayersModel('http://model-server.domain/download/model.json');
const model2 = await tf.loadLayersModel('file://path/to/my-model/model.json');

Serialization


The tensor flow utility provides an alternate method for serializing a model to json text and to deserialize the model from the json.

let ut = await import('/lib/tensor-flow/util/v1.0.0/util.mjs');

let text = await ut.serialize(model);
let model2 = await ut.deserialize(text);
				

Contents