Skip to content

Save the Tensorflow.js models to the filesystem of ANY Node environment

License

Notifications You must be signed in to change notification settings

radi-cho/tfjs-node-save

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tfjs-node-save

The official way to save models in a Node environment is tfjs-node.
It also enhances the performance, registrers backend and allows us to use GPUs.

But tfjs-node is not supported on all operating systems, node versions, etc.
Here comes tfjs-node-save - It allows you to use the native filesystem features of tfjs-node, but excludes everything else, so it is supported in any Node environment.

In order tfjs-node-save to work efficiently you should use Node v.8 or higher.**

Usage

const tf = rquire("@tensorflow/tfjs");
require("tfjs-node-save");
model.save("file://PATH");

Refer to the official documentation on how to use the filesystem saving features.

The file:// URL scheme can be used for model saving and loading. For model saving, the scheme is followed by the path to the directory in which the model artifacts are to be saved, for example:

model.save("file://C:/tmp/").then(function() {
  console.log("Successfully saved the artifacts.");
});

Related content

About

Save the Tensorflow.js models to the filesystem of ANY Node environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published