• Remove a model specified by URL from a registered storage medium.

    // First create and save a model.
    const model = tf.sequential();
    model.add(tf.layers.dense(
    {units: 1, inputShape: [10], activation: 'sigmoid'}));
    await model.save('localstorage://demo/management/model1');

    // Then list existing models.
    console.log(JSON.stringify(await tf.io.listModels()));

    // Delete the model.
    await tf.io.removeModel('localstorage://demo/management/model1');

    // List models again.
    console.log(JSON.stringify(await tf.io.listModels()));

    Parameters

    • url: string

      A URL to a stored model, with a scheme prefix, e.g., 'localstorage://my-model-1', 'indexeddb://my/model/2'.

    Returns Promise<ModelArtifactsInfo>

    ModelArtifactsInfo of the deleted model (if and only if deletion is successful).

    Error if deletion fails, e.g., if no model exists at path.