Delete Model

delete_model(self, model_id: str, recursive: bool = False) → None

Delete the model for a given model ID.

Parameters
  • model_id (str) – The ID of the model.

  • recursive (bool, optional) – Whether to also delete the compressed model for that model. Defaults to False.

Raises

e – If an error occurs while deleting the model.

Details of Parameters

Recursive

Warning

Deleting the model will also delete its compressed models. To proceed with the deletion, set the recursive parameter to True.

Note

If the recursive parameter is set to True, the compressed model for that model will also be deleted.

Example

If the model has a compressed model, and recursive is False

from netspresso.compressor import ModelCompressor


compressor = ModelCompressor(email="YOUR_EMAIL", password="YOUR_PASSWORD")
compressor.delete_model(model_id="YOUR_MODEL_ID")

Output

Deleting model...
Deleting the model will also delete its compressed models. To proceed with the deletion, set the `recursive` parameter to True.

If the model has a compressed model, and recursive is True

from netspresso.compressor import ModelCompressor


compressor = ModelCompressor(email="YOUR_EMAIL", password="YOUR_PASSWORD")
compressor.delete_model(model_id="YOUR_MODEL_ID", recursive=True)

Output

Deleting model...
The compressed model for that model will also be deleted.
Delete model successful.

If there is no compressed model in the model

from netspresso.compressor import ModelCompressor


compressor = ModelCompressor(email="YOUR_EMAIL", password="YOUR_PASSWORD")
compressor.delete_model(model_id="YOUR_MODEL_ID")

Output

Deleting model...
The model will be deleted.
Delete model successful.