question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTPErrors when accessing & downloading artifacts from wandb.Api()

See original GitHub issue

wandb --version && python --version && uname

  • Weights and Biases version: 0.9.2
  • Python version: 3.6.10
  • Operating System: Windows 10

Description

I’m trying to download an artifact using Api().

  1. I get an error “Bad Request for url: https://api.wandb.ai/graphql” upon getting artifact object when using API without parameters. This problem seems to be similar to https://github.com/wandb/client/issues/1111 (Note that I use wandb 0.9.2 where the https://github.com/wandb/client/issues/1111 issue is already fixed, as I understood)
api = wandb.Api()
artifact = api.artifact(name='shirts-artifacts-resume_2uhu1z1m_checkpoint:latest')
print('Downloading')
path = artifact.download('./wandb/test-dwld')
print(path)
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\__init__.py", line 72, in wrapper
    return func(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\public.py", line 454, in artifact
    return Artifact(self.client, entity, project, artifact_name)
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\public.py", line 1959, in __init__
    self._load()
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\public.py", line 2165, in _load
    'name': self.artifact_name,
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\retry.py", line 130, in wrapped_fn
    return retrier(*args, **kargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\retry.py", line 95, in __call__
    result = self._call_fn(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\public.py", line 151, in execute
    return self._client.execute(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\gql\client.py", line 52, in execute
    result = self._get_result(document, *args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\gql\client.py", line 60, in _get_result
    return self.transport.execute(document, *args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\gql\transport\requests.py", line 39, in execute
    request.raise_for_status()
  File "C:\ProgramData\Anaconda3\lib\site-packages\requests\models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.wandb.ai/graphql

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\MyProject\tmp.py", line 7, in <module>
    artifact = api.artifact(name='shirts-artifacts-resume_2uhu1z1m_checkpoint:latest')
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\__init__.py", line 74, in wrapper
    raise CommError(err.response, err)
wandb.apis.CommError: <Response [400]>
  1. I tried to find a workaround to the above pproblem. The error goes away when I initialize Api() object with entity, project & run_id info, but then I get errors on downloading:
api = wb.Api({'entity': 'maria_korosteleva', 'project': 'Test-Garments-Reconstruction', 'run_id': '2uhu1z1m'})

artifact = api.artifact(name='shirts-artifacts-resume_2uhu1z1m_checkpoint:latest')
print('Downloading')
path = artifact.download('./wandb/test-dwld')
print(path)

Error:

Downloading
Traceback (most recent call last):
  File "d:\MyDocs\GigaKorea\Garment Pattern Estimation\tmp.py", line 12, in <module>
    path = artifact.download('./wandb/test-dwld')
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\public.py", line 2085, in download
    pool.map(download_file, manifest.entries)
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 266, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 644, in get
    raise self._value
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 44, in mapstar
    return list(map(*args))
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\public.py", line 2075, in download_file
    cache_path = self.get_path(name).download()
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\apis\public.py", line 2033, in download
    return storage_policy.load_file(self, name, manifest.entries[name])
  File "C:\ProgramData\Anaconda3\lib\site-packages\wandb\artifacts.py", line 442, in load_file
    response.raise_for_status()
  File "C:\ProgramData\Anaconda3\lib\site-packages\requests\models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.wandb.ai/artifacts/None/ed5f7b1c16414b31e72706db1aef3cca

Note that if I change ‘None’ in the final URL to my wandb nickname, I’m able to download the file through the browser.

I place both problems into one issue because I have a feeling they are related. Let me know if I’m wrong and should separate them.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
issue-label-bot[bot]commented, Jul 9, 2020

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.86. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

1reaction
tyomhakcommented, Jul 9, 2020

Thank you very much for reporting! We’ll try to recreate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTPErrors when accessing & downloading artifacts ... - GitHub
I'm trying to download an artifact using Api(). I get an error "Bad Request for url: https://api.wandb.ai/graphql" upon getting artifact object ...
Read more >
wandb.Artifact - Documentation - Weights & Biases
NOTE: This will raise an error unless the artifact has been fetched using use_artifact , fetched using the API, or wait() has been...
Read more >
Wandb throws Permission denied error although I am logged in
In my situation I was trying to download a model using wandb Api file_name = "model.h5" api = wandb.Api() run = api.run( ...
Read more >
Environment information (required) - You.com
I am trying to build an app from a python file (Mac OS) using the py2app ... from TikTokApi import TikTokApi api =...
Read more >
ml-transfer-learning-fine-tuning | Kaggle
Validation distribution validation.groupby('sentiment').count().plot.bar() ... wandb: ERROR API key must be 40 characters long, yours was 19 wandb: You can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found