Hi everybody! Iām running the Kaggle notebook for the first lesson, but when running line 20:
from fastdownload import download_url
dest = 'bird.jpg'
download_url(urls[0], dest, show_progress=False)
from fastai.vision.all import *
im = Image.open(dest)
im.to_thumb(256,256)
I get a truly enormous error consisting of the below followed by (what looks like) the html for a webpage or several webpages about birds, which is labelled as āHTTP error 404, ===ERROR BODY===ā
HTTPError Traceback (most recent call last)
/tmp/ipykernel_17/3449441972.py in <module>
1 from fastdownload import download_url
2 dest = 'bird.jpg'
----> 3 download_url(urls[0], dest, show_progress=False)
4
5 from fastai.vision.all import *
/opt/conda/lib/python3.7/site-packages/fastdownload/core.py in download_url(url, dest, timeout, show_progress)
21 pbar.total = tsize
22 pbar.update(count*bsize)
---> 23 return urlsave(url, dest, reporthook=progress if show_progress else None, timeout=timeout)
24
25 # Cell
/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlsave(url, dest, reporthook, headers, timeout)
182 dest = urldest(url, dest)
183 dest.parent.mkdir(parents=True, exist_ok=True)
--> 184 nm,msg = urlretrieve(url, dest, reporthook, headers=headers, timeout=timeout)
185 return nm
186
/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlretrieve(url, filename, reporthook, data, headers, timeout)
147 def urlretrieve(url, filename=None, reporthook=None, data=None, headers=None, timeout=None):
148 "Same as `urllib.request.urlretrieve` but also works with `Request` objects"
--> 149 with contextlib.closing(urlopen(url, data, headers=headers, timeout=timeout)) as fp:
150 headers = fp.info()
151 if filename: tfp = open(filename, 'wb')
/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlopen(url, data, headers, timeout, **kwargs)
106 if not isinstance(data, (str,bytes)): data = urlencode(data)
107 if not isinstance(data, bytes): data = data.encode('ascii')
--> 108 try: return urlopener().open(urlwrap(url, data=data, headers=headers), timeout=timeout)
109 except HTTPError as e:
110 e.msg += f"\n====Error Body====\n{e.read().decode(errors='ignore')}"
/opt/conda/lib/python3.7/urllib/request.py in open(self, fullurl, data, timeout)
529 for processor in self.process_response.get(protocol, []):
530 meth = getattr(processor, meth_name)
--> 531 response = meth(req, response)
532
533 return response
/opt/conda/lib/python3.7/urllib/request.py in http_response(self, request, response)
639 if not (200 <= code < 300):
640 response = self.parent.error(
--> 641 'http', request, response, code, msg, hdrs)
642
643 return response
/opt/conda/lib/python3.7/urllib/request.py in error(self, proto, *args)
567 if http_err:
568 args = (dict, 'default', 'http_error_default') + orig_args
--> 569 return self._call_chain(*args)
570
571 # XXX probably also want an abstract factory that knows when it makes
/opt/conda/lib/python3.7/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
501 for handler in handlers:
502 func = getattr(handler, meth_name)
--> 503 result = func(*args)
504 if result is not None:
505 return result
/opt/conda/lib/python3.7/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
647 class HTTPDefaultErrorHandler(BaseHandler):
648 def http_error_default(self, req, fp, code, msg, hdrs):
--> 649 raise HTTPError(req.full_url, code, msg, hdrs, fp)
650
651 class HTTPRedirectHandler(BaseHandler):
Any ideas whatās going on here? I tried a Chromium browser (Opera) just in case Firefox was breaking something, but no luck. Pretty stumped, as I only started learning python at all very recently.