Hello,
I am currently trying to go through lesson 1 and I keep receiving an error when I try to execute the following code : path = untar_data(URLs.PETS); path.
I noticed that it seems to be a connection error so I checked the url for URLs.PETS which shows up as “https://s3.amazonaws.com/fast-ai-imageclas/oxford-iiit-pet” but that url seems to be broken.
I am using a mac but I am doing the actual lesson via Kaggle kernel. I have also been able to replicate this issue through colab so I was wondering if someone could point out what I could be doing wrong. I copy pasted the error I am receiving below.
Thank you for your time.
gaierror Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self)
140 conn = connection.create_connection(
–> 141 (self.host, self.port), self.timeout, **extra_kw)
142
/opt/conda/lib/python3.6/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
59
—> 60 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
61 af, socktype, proto, canonname, sa = res
/opt/conda/lib/python3.6/socket.py in getaddrinfo(host, port, family, type, proto, flags)
744 addrlist = []
–> 745 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
746 af, socktype, proto, canonname, sa = res
gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
600 body=body, headers=headers,
–> 601 chunked=chunked)
602
/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
345 try:
–> 346 self._validate_conn(conn)
347 except (SocketTimeout, BaseSSLError) as e:
/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
849 if not getattr(conn, ‘sock’, None): # AppEngine might not have .sock
–> 850 conn.connect()
851
/opt/conda/lib/python3.6/site-packages/urllib3/connection.py in connect(self)
283 # Add certificate verification
–> 284 conn = self._new_conn()
285
/opt/conda/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self)
149 raise NewConnectionError(
–> 150 self, “Failed to establish a new connection: %s” % e)
151
NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fe28738cbe0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
448 retries=self.max_retries,
–> 449 timeout=timeout
450 )
/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
638 retries = retries.increment(method, url, error=e, _pool=self,
–> 639 _stacktrace=sys.exc_info()[2])
640 retries.sleep()
/opt/conda/lib/python3.6/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
387 if new_retry.is_exhausted():
–> 388 raise MaxRetryError(_pool, url, error or ResponseError(cause))
389
MaxRetryError: HTTPSConnectionPool(host=‘s3.amazonaws.com’, port=443): Max retries exceeded with url: /fast-ai-imageclas/oxford-iiit-pet.tgz (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe28738cbe0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’,))
During handling of the above exception, another exception occurred:
ConnectionError Traceback (most recent call last)
in ()
----> 1 path = untar_data(URLs.PETS); path
/opt/conda/lib/python3.6/site-packages/fastai/datasets.py in untar_data(url, fname, dest, data, force_download)
221 if dest.exists(): shutil.rmtree(dest)
222 if not dest.exists():
–> 223 fname = download_data(url, fname=fname, data=data)
224 data_dir = Config().data_path()
225 if url in _checks:
/opt/conda/lib/python3.6/site-packages/fastai/datasets.py in download_data(url, fname, data, ext)
203 if not fname.exists():
204 print(f’Downloading {url}’)
–> 205 download_url(f’{url}{ext}’, fname)
206 return fname
207
/opt/conda/lib/python3.6/site-packages/fastai/core.py in download_url(url, dest, overwrite, pbar, show_progress, chunk_size, timeout, retries)
174 s = requests.Session()
175 s.mount(‘http://’,requests.adapters.HTTPAdapter(max_retries=retries))
–> 176 u = s.get(url, stream=True, timeout=timeout)
177 try: file_size = int(u.headers[“Content-Length”])
178 except: show_progress = False
/opt/conda/lib/python3.6/site-packages/requests/sessions.py in get(self, url, **kwargs)
544
545 kwargs.setdefault(‘allow_redirects’, True)
–> 546 return self.request(‘GET’, url, **kwargs)
547
548 def options(self, url, **kwargs):
/opt/conda/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
531 }
532 send_kwargs.update(settings)
–> 533 resp = self.send(prep, **send_kwargs)
534
535 return resp
/opt/conda/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
644
645 # Send the request
–> 646 r = adapter.send(request, **kwargs)
647
648 # Total elapsed time of the request (approximately)
/opt/conda/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
514 raise SSLError(e, request=request)
515
–> 516 raise ConnectionError(e, request=request)
517
518 except ClosedPoolError as e:
ConnectionError: HTTPSConnectionPool(host=‘s3.amazonaws.com’, port=443): Max retries exceeded with url: /fast-ai-imageclas/oxford-iiit-pet.tgz (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe28738cbe0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’,))