How to remove corrupted model versions
Hi,
As you can see from below pictures, one model went wrong. From the Job view, it shows this job failed, and in the saved models, this "half-generated" model sticks here. I can't even find check box on the left. How could I remove it? this model causes an error when looping the saved models with python script.
Thanks,
Lj
Best Answer
-
Hi Lj,
Small addition to your solution: you can type "running" in the filter on the saved model page, then click on a checkbox on the left of the "actions" button to select all of the corrupted versions. Then click Actions -> Delete
A second solution could be by creating a python notebook and running this snippet (change SAVED_MODEL_ID):
import dataiku
import dataikuapiSAVED_MODEL_ID = '0tqFKYBZ'
pk = dataiku.Project().project_key
c=dataiku.api_client()
p=c.get_project(pk)
m=dataiku.Model(SAVED_MODEL_ID)sm=dataikuapi.dss.savedmodel.DSSSavedModel(c,pk,SAVED_MODEL_ID)
versions_to_delete = [v['versionId'] for v in m.list_versions() if v['snippet']['trainInfo']['state'] != 'DONE']
sm.delete_versions(versions_to_delete)Regards,
Andrey
Answers
-
I managed to delete this model. First check the box on the upper left corner to tick on all the model versions, then un-tick all the normal versions, and delete.
This looks like a small defect, the developer may need to amend this.
Thanks,
Lj
-
Thanks Andrey, both solutions are much more advanced and convenient than my solution. Thanks, really appreciate it.