Open chadmcgrath opened 5 years ago
model = await Model.loadFromFile('indexeddb://my-model')
// ...
await model.export('my-model', 'indexeddb')
if in nodejs you need to hack
import { NodeFileSystem } from "@tensorflow/tfjs-node/dist/io/file_system"
//...
await model.model.save(new NodeFileSystem('./model))
//...
@Baael how do you load it, if I run it in node I get:
ReferenceError: fetch is not defined
and this can be skipped if the model is loaded, right:
// Now we initialize our model, and start adding layers
this.model = new ReImprove.Model.FromNetwork(this.network, this.options.modelFitConfig);
// Finally compile the model, we also exactly use tfjs's optimizers and loss functions
// (So feel free to choose one among tfjs's)
this.model.compile({loss: 'meanSquaredError', optimizer: 'sgd'})
how do you do this for the browser?
I'm getting this:
I see a loadFromFile() method but I'm not sure how to save the model. Is there an easy way to do that?