- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021 05:13 AM
I am using ML flow and my need of the hour is to delete an experiment and want to create another experiment with same run.
client = MlflowClient(tracking_uri=server)
client.delete_experiment(1)
This deletes the
experiment, but when I run a new experiment with the same name as the one I just deleted, it will return this error:
You can restore the experiment, or permanently delete the experiment to create a new one
- Labels:
-
MlFlow
-
MLflow Experiment
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021 05:15 AM
I think this is the limitation and now we have no way to do this via the UI or CLI
The way to do it depends on the type of backend file store that you are using.
If you are using file store it is easy as the deleted experiment is stored in the trash folder
.t
rm -rf mlruns/.trash/*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021 05:15 AM
I think this is the limitation and now we have no way to do this via the UI or CLI
The way to do it depends on the type of backend file store that you are using.
If you are using file store it is easy as the deleted experiment is stored in the trash folder
.t
rm -rf mlruns/.trash/*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021 05:16 AM
SQL Database:
This is more tricky, as there are dependencies that need to be deleted. I am using MySQL, and these commands work for me:
USE mlflow_db; # the name of your database
DELETE FROM experiment_tags WHERE experiment_id=ANY(
SELECT experiment_id FROM experiments where lifecycle_stage="deleted"
);
DELETE FROM latest_metrics WHERE run_uuid=ANY(
SELECT run_uuid FROM runs WHERE experiment_id=ANY(
SELECT experiment_id FROM experiments where lifecycle_stage="deleted"
)
);
DELETE FROM metrics WHERE run_uuid=ANY(
SELECT run_uuid FROM runs WHERE experiment_id=ANY(
SELECT experiment_id FROM experiments where lifecycle_stage="deleted"
)
);
DELETE FROM tags WHERE run_uuid=ANY(
SELECT run_uuid FROM runs WHERE experiment_id=ANY(
SELECT experiment_id FROM experiments where lifecycle_stage="deleted"
)
);
DELETE FROM runs WHERE experiment_id=ANY(
SELECT experiment_id FROM experiments where lifecycle_stage="deleted"
);
DELETE FROM experiments where lifecycle_stage="deleted";

