I unfortunately set the log model flag to “all” instead in a sweep of experiments.
wandb_logger = WandbLogger(
This led to the cluttering of my wandb workspace with a lot of large models, that I do not need.
Now to my question: Is there a way to delete all models that do not contain the
best flag in the UI or connect to my workspace from a python script and do it from there?
Hi @marcs, you can iterate through your Artifacts in the project and delete models that do not contain the “best” aliases like this:
project = "<entity/project_name>"
api = wandb.Api()
runs = api.runs(project)
for run in runs:
for art in run.logged_artifacts():
if "best" not in art.aliases:
I’ve commented out the delete function so you can check and make sure that this is only going to delete artifacts you’d like before uncommenting the delete function.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.