Beginner: Setup ✅

Me too - the exact same error.

@hewag1975, @Devesh2000, @oliverbogler,
As a diagnostic, select menu Run > Factory Reset, then add the following cell to the top of the notebook and execute it…

!pip install -U requests
import requests 
print("IMPORTED VERSION IS ", requests.__version__)
from requests.exceptions import JSONDecodeError
print("NOW OKAY")

and you might see…

Although you see it reports that version 2.31.0 was successfuly installed in the operating system, it shows an older version 2.26.0 was imported from a cache.

Now go Run > Restart and clear outputs, and run that first cell again. This time you should see…
image

and your original problem should also have been resolved.

The root cause was that history shows JSONDecodeError was not added until version 2.27.0

5 Likes

Thank you - that has indeed removed this error - much appreciated.

Does anyone have a functioning version of the 'Is it a bird? notebook on Kaggle that they can share? With bencoman’s help I no longer have the JSONDecodeError, but I cannot for the life of me get duck duck go to work - I believe that the code in the notebook provided with the course is out of date, but I have not been able to get even a simple image search to work…

1 Like

Thanks. It solved the error

Hey, I could just fix the problem by following the thread

You can comment on the search_images block and instead use this

!pip install fastbook

Import fastbook functions, in our case we’ll be using: search_images_ddg

from fastbook import *

create a function that will take an arbitrary search term and return a list of urls.

def search_images(term, max=30):
print(f"Searching for ‘{term}’")

search_images_ddg comes from fastbook: fastbook/utils.py at master · fastai/fastbook · GitHub

return search_images_ddg(term, max_images=max)

urls = search_images(“cats eating ice cream”)

3 Likes

Hey, Can you tell me how did you post the cell

Thanks. That worked - appreciate the tip.

I’m so confused as to where to get started? I have a Kaggle account, and in the book title ‘Running your first Notebook’ for lesson 1 there is an examples ‘00-intro’, but I can’t seem to find this anywhere? Meanwhile the links form Lesson 1 all point to ‘Is it a bird?’ or ‘Jupyter 101’?

Am I meant to pull something in from Github or something?

Kaggle doesn’t look anything like Jupyter? I’m not sure where I should be using Jupyter?

1 Like

Kaggle notebooks are in fact jupyter notebooks but the UI is a little different(and you are using Kaggles gpus). There are many ways to run the notebooks in the course: colab, kaggle, paperspace, locally. And any of these methods are fine.

1 Like

When I tried running the 2nd command on Kaggle from the 'Is it a bird?.. ’ notebook, I got an error related to dependencies (shown below); I ignored the error and tried to execute next cells and on 4th Cell, I got another error (also shown below)…Can you please help me understand the reason and how can I fix it?

Error on Running Command 2:
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow-io 0.21.0 requires tensorflow-io-gcs-filesystem==0.21.0, which is not installed.
explainable-ai-sdk 1.3.2 requires xai-image-widget, which is not installed.
dask-cudf 21.10.1 requires cupy-cuda114, which is not installed.
beatrix-jupyterlab 3.1.6 requires google-cloud-bigquery-storage, which is not installed.
tensorflow 2.6.2 requires numpy~=1.19.2, but you have numpy 1.20.3 which is incompatible.
tensorflow 2.6.2 requires six~=1.15.0, but you have six 1.16.0 which is incompatible.
tensorflow 2.6.2 requires typing-extensions~=3.7.4, but you have typing-extensions 3.10.0.2 which is incompatible.
tensorflow 2.6.2 requires wrapt~=1.12.1, but you have wrapt 1.13.3 which is incompatible.
tensorflow-transform 1.5.0 requires absl-py<0.13,>=0.9, but you have absl-py 0.15.0 which is incompatible.
tensorflow-transform 1.5.0 requires numpy<1.20,>=1.16, but you have numpy 1.20.3 which is incompatible.
tensorflow-transform 1.5.0 requires pyarrow<6,>=1, but you have pyarrow 6.0.1 which is incompatible.
tensorflow-transform 1.5.0 requires tensorflow!=2.0.,!=2.1.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.*,<2.8,>=1.15.2, but you have tensorflow 2.6.2 which is incompatible.
tensorflow-serving-api 2.7.0 requires tensorflow<3,>=2.7.0, but you have tensorflow 2.6.2 which is incompatible.
gcsfs 2021.11.1 requires fsspec==2021.11.1, but you have fsspec 2022.2.0 which is incompatible.
flake8 4.0.1 requires importlib-metadata<4.3; python_version < “3.8”, but you have importlib-metadata 4.11.3 which is incompatible.
featuretools 1.6.0 requires numpy>=1.21.0, but you have numpy 1.20.3 which is incompatible.
dask-cudf 21.10.1 requires dask==2021.09.1, but you have dask 2022.2.0 which is incompatible.
dask-cudf 21.10.1 requires distributed==2021.09.1, but you have distributed 2022.2.0 which is incompatible.
apache-beam 2.34.0 requires dill<0.3.2,>=0.3.1.1, but you have dill 0.3.4 which is incompatible.
apache-beam 2.34.0 requires httplib2<0.20.0,>=0.8, but you have httplib2 0.20.2 which is incompatible.
apache-beam 2.34.0 requires pyarrow<6.0.0,>=0.15.1, but you have pyarrow 6.0.1 which is incompatible.
aioitertools 0.10.0 requires typing_extensions>=4.0; python_version < “3.10”, but you have typing-extensions 3.10.0.2 which is incompatible.
aiobotocore 2.1.2 requires botocore<1.23.25,>=1.23.24, but you have botocore 1.24.20 which is incompatible.

Error on Running Command 4:
/opt/conda/lib/python3.7/site-packages/duckduckgo_search/compat.py:60: UserWarning: ddg_images is deprecated. Use DDGS().images() generator
warnings.warn(“ddg_images is deprecated. Use DDGS().images() generator”)
/opt/conda/lib/python3.7/site-packages/duckduckgo_search/compat.py:64: UserWarning: parameter page is deprecated
warnings.warn(“parameter page is deprecated”)
/opt/conda/lib/python3.7/site-packages/duckduckgo_search/compat.py:66: UserWarning: parameter max_results is deprecated
warnings.warn(“parameter max_results is deprecated”)

HTTPError Traceback (most recent call last)
/tmp/ipykernel_17/2432147335.py in
1 #NB: search_images depends on duckduckgo.com, which doesn’t always return correct responses.
2 # If you get a JSON error, just try running it again (it may take a couple of tries).
----> 3 urls = search_images(‘bird photos’, max_images=1)
4 urls[0]

/tmp/ipykernel_17/1717929076.py in search_images(term, max_images)
4 def search_images(term, max_images=30):
5 print(f"Searching for ‘{term}’")
----> 6 return L(ddg_images(term, max_results=max_images)).itemgot(‘image’)

/opt/conda/lib/python3.7/site-packages/duckduckgo_search/compat.py in ddg_images(keywords, region, safesearch, time, size, color, type_image, layout, license_image, max_results, page, output, download)
80 type_image=type_image,
81 layout=layout,
—> 82 license_image=license_image,
83 ):
84 results.append(r)

/opt/conda/lib/python3.7/site-packages/duckduckgo_search/duckduckgo_search.py in images(self, keywords, region, safesearch, timelimit, size, color, type_image, layout, license_image)
311 cache = set()
312 for _ in range(10):
→ 313 resp = self._get_url(“GET”, “https://duckduckgo.com/i.js”, params=payload)
314 if resp is None:
315 break

/opt/conda/lib/python3.7/site-packages/duckduckgo_search/duckduckgo_search.py in _get_url(self, method, url, **kwargs)
68 logger.warning(f"_get_url() {url} {type(ex).name} {ex}")
69 if i >= 2 or “418” in str(ex):
—> 70 raise ex
71 sleep(3)
72 return None

/opt/conda/lib/python3.7/site-packages/duckduckgo_search/duckduckgo_search.py in _get_url(self, method, url, **kwargs)
62 if self._is_500_in_url(resp.url) or resp.status_code == 202:
63 raise requests.HTTPError
—> 64 resp.raise_for_status()
65 if resp.status_code == 200:
66 return resp

/opt/conda/lib/python3.7/site-packages/requests/models.py in raise_for_status(self)
951
952 if not self.encoding and self.content and len(self.content) > 3:
→ 953 # No encoding set. JSON RFC 4627 section 3 states we should expect
954 # UTF-8, -16 or -32. Detect which one to use; If the detection or
955 # decoding fails, fall back to self.text (using charset_normalizer to make

HTTPError: 403 Client Error: Forbidden for url: https://duckduckgo.com/i.js?l=wt-wt&o=json&s=0&q=bird+photos&vqd=4-117791107778443701629606176197253027971&f=%2C%2C%2C%2C%2C&p=1

1 Like

I am also facing this issue

Thank you for your time and work.

Question: I can run bird/forest in Kaggle and also locally in Jupyter Notebook.
My question is my Pytorch returned this
1.13.1+cpu
Will I be able to follow on locally with my CPU or shall I kaggle it ( i do not have a paid Kaggle subscription ).
Thank you.
Ido

Hello Community Friends,

I started yesterday and watched Video 1 from Part1 2022. After fixing a few errors that I got while trying to setup a fastpages blog on github I was finally able to setup this at - https://chetan2309.github.io/deeplearning/

However, the page looks off from styling perspective. Seems like some CSS is missing!!

Has anyone faced this issue before and can provide a workaround please?

Cheers,
Chetan

Did you ever get this figured out? I’m confused about the same thing. Where are the options/tutorials on the website?

Running locally on cpu will be extremely slow. Free options with GPU exist for running Jupyter notebooks. The common ones are Google Colab, Kaggle and a lesser known is https://studiolab.sagemaker.aws/.
(On each you will need to specifically select that you want it to run on GPU)

If you have a recent Nvidia card on your own machine, it may be a matter of reinstalling Pytorch with a cuda version that your card supports, follow install instructions from Pytorch.org

1 Like

Thank you so much for the information. I will check them out I would like to pay a year lump sum and be able to engage off if my circumstances change. I hope they make ending the engagement easy. If you have any info on this please share, and thanks again. I.

Does anyone have a reliable setup recommendation for cloud GPU offerings?

I’m trying to follow the text transfer learning section of the docs which requires training a language model on IMDB reviews prior to the classifier step.

In the last 72+ hours, I’ve tried Google Colab (free & purchasing computing units), Codespace & Kaggle. Here’s my issue: each epoch takes ~50minutes! and I need to run 10 epochs. 1) This seems very slow to me 2) The Colab & Kaggle notebooks timeout

Open to advise and/or corrections. :smile:

Okay, I’ve found a temporary workaround that won’t break my wallet. I found an old laptop in storage with a 2GB GPU. It’s mighty slow but it’s free and I don’t have to worry about timeouts. I will stick to Kaggle for the lessons (considering the GPU limit per week) and use the laptop for long training exercises.

Hello Everyone, I am trying to install fastai as mentioned by Jeremy in his second video in 31 minutes and 54 minutes. I have 2 questions

  1. I believe the Windows terminal is installed but it always shows as “Windows Powershell” is it okay and the same thing?
  2. I downloaded vim added to the path as it was not recognising it earlier and it gives me same screen as in video but when I re-run the terminal, it does not recognise the mamba command?

Anyone who has done this setup on the system and would like to share their steps? Thank you