Moving within a storage medium, e.g.,
tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')
Moving between two storage mediums, e.g.,
tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')
// First create and save a model. constmodel = tf.sequential(); model.add(tf.layers.dense( {units:1, inputShape: [10], activation:'sigmoid'})); awaitmodel.save('localstorage://demo/management/model1');
// Then list existing models. console.log(JSON.stringify(awaittf.io.listModels()));
// Move the model, from Local Storage to IndexedDB. awaittf.io.moveModel( 'localstorage://demo/management/model1', 'indexeddb://demo/management/model1');
// List models again. console.log(JSON.stringify(awaittf.io.listModels()));
// Remove the moved model. awaittf.io.removeModel('indexeddb://demo/management/model1');
Move a model from one URL to another.
This function supports:
tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')
tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')