import wandb
api = wandb.Api()
runs = api.sweep(f"{team_name}/{project_name}/{sweep_id}").runs
run = sorted(runs, key=lambda run: run.summary.get("val_accuracy", 0), reverse=True)[0]
run.file(f"{path}{run.name}.h5").download(replace=True)
And I get a “Permission denied, ask the project owner to grant you access” error on the run.file().download(), even though I followed the tutorial. I tried this in two different settings, (1) in a team where I am the admin and (2) on my personal account (note that these are the “team_name” I am using in the api.sweep).
It does find my sweep and the runs, I can also see the validation accuracies of all runs, it just doesn’t allow me to download the files.
Furthermore, and this might be unrelated, whenever I try to inspect the run elements in my pycharm, the debugger crashes. This has never happened before, but it’s consistent on my machine, crashing my debugger every time
You should be able to access your artifact through run.logged_artifacts(). I’ve written a small script for you (though you might have to edit it a little bit) to achieve this for you:
api = wandb.Api()
sweep = api.sweep(f'{entity}/{project}/{sweep_id}')
runs = sweep.runs
runs = sorted(runs, key = lambda run: run.summary.get('val_loss'))
best_run = runs[0]
artifacts = best_run.logged_artifacts()
best_model = [artifact for artifact in artifacts if artifact.type == 'model'][0]
best_model.download()
The artifacts list is empty, I suspect this is because I never configured it to log or send any artifacts during my sweep? Sadly though, this answer doesn’t fix the issue due to that fact. Still have not figured out why I am getting an access error when trying to download from my own account.
I also tried it on my Linux server (my PC is windows), to see if it was machine specific, but it wasn’t. I get the exact same issue on the Linux server.
We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.
Hi Tobias, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!