Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib issue urllib.error.HTTPError: HTTP Error 503: Service Unavailable #12

Open
FischerJo opened this issue Mar 23, 2021 · 0 comments

Comments

@FischerJo
Copy link

I just installed the dependencies and tried to run the example

python3 main.py --prune_type=lt --arch_type=fc1 --dataset=mnist --prune_percent=10 --prune_iterations=35

and got the following error

Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to ../data/MNIST/raw/train-images-idx3-ubyte.gz
Traceback (most recent call last):
  File "main.py", line 427, in <module>
    main(args, ITE=1)
  File "main.py", line 39, in main
    traindataset = datasets.MNIST('../data', train=True, download=True,transform=transform)
  File "/home/fischer/miniconda3/lib/python3.8/site-packages/torchvision/datasets/mnist.py", line 79, in __init__
    self.download()
  File "/home/fischer/miniconda3/lib/python3.8/site-packages/torchvision/datasets/mnist.py", line 146, in download
    download_and_extract_archive(url, download_root=self.raw_folder, filename=filename, md5=md5)
  File "/home/fischer/miniconda3/lib/python3.8/site-packages/torchvision/datasets/utils.py", line 314, in download_and_extract_archive
    download_url(url, download_root, filename, md5)
  File "/home/fischer/miniconda3/lib/python3.8/site-packages/torchvision/datasets/utils.py", line 140, in download_url
    raise e
  File "/home/fischer/miniconda3/lib/python3.8/site-packages/torchvision/datasets/utils.py", line 132, in download_url
    _urlretrieve(url, fpath)
  File "/home/fischer/miniconda3/lib/python3.8/site-packages/torchvision/datasets/utils.py", line 29, in _urlretrieve
    with urllib.request.urlopen(urllib.request.Request(url, headers={"User-Agent": USER_AGENT})) as response:
  File "/home/fischer/miniconda3/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/home/fischer/miniconda3/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/home/fischer/miniconda3/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/home/fischer/miniconda3/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/home/fischer/miniconda3/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/home/fischer/miniconda3/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 503: Service Unavailable

My guess is that the side somehow blocks the request (blocks python script requests, requires captcha solving,...), as a google search revealed similar issues with this library.
Is there any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant