Beginner: Setup ✅


I am getting status error as I run the cell:
urls = search_images(‘bird photos’, max_images=1)
urls[0]
Can anyone please help and I am so much confused between whether to use Kaggle or Colab are the content in both notebooks same?

If I remember correctly, I’ve faced the same issue before. I’m not sure if this will help for your case, but try running this instead:

searches = 'photo of a damaged car','photo of a car'
path = Path('car_damage')

for o in searches:
    dest = (path/o)
    dest.mkdir(exist_ok=True, parents=True)
    try:
        download_images(dest, urls=search_images(f'{o} photo'))
        resize_images(dest, max_size=400, dest=dest)
    except Exception as e:
        print(f"An error occurred: {e}")
1 Like

In my case, I had to run it multiple times to get it to work, but there might be a more efficient way to solve it…

As for the Kaggle vs Colab, I believe there are some lessons in Kaggle Notebooks as you progress through the course, and the textbook is available on Colab. I personally use both platforms. When working through the textbook, I fork the notebook and use my own copy in Colab. And the ease with Kaggle is that you have easy access to the datasets.

Hi, I’m having an issue with the “Is it a bird?” exercise.

The !pip install command is failing… I don’t know why and how to fix this. The internet is connected.

2 Likes

Hi @FireMeetGasoline,

I ran into the same issue and stumbled about the notebook from @chizkidd (see his comment below). I tested his notebook and it worked. Despite his code changes the only difference was that the environment preferences were set to “Pin to original environment”. I checked my copy of this notebook and it was set to “Always use latest environment”.

After switching back to “Pint to original environment” the error was gone and I was able to run the whole notebook :partying_face:

Hope this works for you, too.

1 Like

I am using python 3.12. I installed fastai using pip in my virtual environment in vscode. while running the statement:
fastai.vision.all import *
I am getting the following error
ModuleNotFoundError: No module named ‘torch._namedtensor_internals’
I am running the notebooks on my personal laptop.

I had my fastai setup using pip on linux :point_down:

# Install required packages first 
sudo apt install python3-venv python3-full 

# Create virtual environment 
python3 -m venv ~/fastai_env 

# Activate it 
source ~/fastai_env/bin/activate

# Upgrade `pip`, `setuptools`, and `wheel`

pip install --upgrade pip setuptools wheel

# Install ipython & Jupyterlab 

pip install ipykernel
pip install jupyterlab

# Install Pytorch from its official site installation manual

pip3 install torch torchvision torchaudio

# Install Fastai , fastbook

pip install fastai
pip install fastbook
pip install sentencepiece

Now , Open the jupyter notebook via terminal (and start doing fastai course):

# Activate the virtual environment
source ~/fastai_env/bin/activate

# To use Jupyter lab 
jupyter lab

# To use Jupyter notebook

jupyter notebook

# To use Jupyter notebook Classic (Jeremy's favorite)
jupyter nbclassic

While setup in my local environment I faced the below issue.
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>

The error is due to the missing Certificate Authority (CA) certificates that are used to verify SSL/TLS connections.

To fix just ran the below command from terminal

/Applications/Python\ 3.12/Install\ Certificates.command

1 Like

this worked, thankslegend!!!

Finally got through Chapter 2. To run notebooks for the first two chapters, I tried Paperspace, JarvisLabs.ai, Kaggle, and Colab. In the end, only Colab worked perfectly. The others all had issues running widgets or running code in the notebook. I spent hours researching workarounds, (re)installing dependencies, upgrading/downgrading jupyter, etc. Those obstacles stalled my learning process quite a lot. My goal is just to learn the material, not learn the tech stack (yet), so I went with the platform that just worked for fastai.

I have an existing google account, so here were my steps:

  1. Go to https://colab.research.google.com/
  2. The “Open Notebook” prompt appears.
  3. Click on “Github” option.
  4. Search for “fastai/fastbook”.
  5. Choose a chapter to import

(Side note: I used the tips here to use the modified code for duckduckgo after spending a couple of hours trying to get Azure image search to work – Lesson 2: Question on How to Get a Bing Image Search API key - #5 by murilogustineli. The end of chapter 2 suggested helping folks one step behind you, so hopefully this helps).

1 Like

thanks , i was facing the same problem but your article help me

1 Like

forum setan arep gawe postingan kudu ngomen disit belis