Lesson 1 official topic

New here so unsure if this has already been answered / addressed –

I was reading chapter 1 of the fastbook & am currently on the How Our Image Recognizer Works section. I was interested to take a look at all of the available fast AI data sets, but it looks like the link embedded for fast.ai datasets collection is pointing to a page that no longer exists. Would someone be able to update that link on the website & also reply with the active link to datasets?

Thanks in advance – PS loving the both the content & the format of the course so far, thanks for all the great work :slight_smile:

The 2022 notebooks are too brief, while the old notebooks are outdated; for example, I couldn’t set up the Azure key today (lesson 2). I’m sure there will be similar cases in the future lessons as well.

I tend to learn the most when I write the code myself, but if I can’t get past the setup phase, I can’t write code.

My question is both specific to today’s lesson, but also around the fast.ai course part 1 as a whole: How exactly can someone in 2025 make the most of this course?

2 Likes

Hi. I’m having an issue with the code in my notebook as I try to adapt the code from the ‘is it a bird’ exercise. When declaring the variable ‘dls’, I get an error for ‘block’ not being defined (as seen in the attached screenshot). TBH, I’m not sure which package/dependency the DataBlock object is being derived from, but in my notebook, I attempted to install duckduckgo_search, fastcore, and fastdownload. This is what I got after running !pip install duckduckgo_search fastcore fastdownload:

Requirement already satisfied: duckduckgo_search in /usr/local/lib/python3.10/dist-packages (7.2.1)
Requirement already satisfied: fastcore in /usr/local/lib/python3.10/dist-packages (1.7.27)
Requirement already satisfied: fastdownload in /usr/local/lib/python3.10/dist-packages (0.0.7)
Requirement already satisfied: click>=8.1.7 in /usr/local/lib/python3.10/dist-packages (from duckduckgo_search) (8.1.7)
Requirement already satisfied: primp>=0.10.0 in /usr/local/lib/python3.10/dist-packages (from duckduckgo_search) (0.10.1)
Requirement already satisfied: lxml>=5.3.0 in /usr/local/lib/python3.10/dist-packages (from duckduckgo_search) (5.3.0)
Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from fastcore) (24.2)
Requirement already satisfied: fastprogress in /usr/local/lib/python3.10/dist-packages (from fastdownload) (1.0.3)

In the code, I have the following import statements:

from duckduckgo_search import DDGS
from fastcore.all import *

from fastdownload import download_url

I’m a bit lost and not sure if I’m missing something or if the there’s something wrong with the code in the screencap, or if there’s possibly something wrong with code that isn’t screencapped. Its my first time posting here, so I don’t know if it’s okay to post the whole notebook, but if it’s needed, I’ll post a link to it.

Screenshot of code and errors:

I am new to this topic and do not have a background in software or technology. The book begins by stating that it is easy to learn, even without technical skills, but I find this quite misleading.

I recently reached the section “Running Your First Notebook” and was surprised to find discrepancies between the book’s instructions and the actual resources available. The book frequently refers to a “website,” but I have been unable to locate anything that matches its description. I did find a website (Practical Deep Learning for Coders - 1: Getting started), but the lessons appear to be slightly different—perhaps they have been updated?

In particular, I am struggling to find the correct notebook to download and begin coding. I may be missing something obvious, but I would greatly appreciate guidance from someone with more experience.

Thank you in advance for your help!

1 Like

Your project is really cool and was helpful. I am new to this course. I was able to learn some new python functions. Great work.

Hi @spbx89, I see this was posted 17 days ago, have you been able to resolve it yet or need assistance?

Hi,
I got help with the issue on the discord and figured it out. Thanks for asking.

1 Like

Hi, I am trying to install fastai on jupyter notebooks
!pip install -Uqq fastai ‘duckduckgo_search>=6.2’

I get this error

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.
pylibcugraph-cu12 24.12.0 requires pylibraft-cu12==24.12., but you have pylibraft-cu12 25.2.0 which is incompatible.
pylibcugraph-cu12 24.12.0 requires rmm-cu12==24.12.
, but you have rmm-cu12 25.2.0 which is incompatible.

I’m having the same issue and when trying to fetch an image I get a 403

Same here.


Does this mean the function automatically decide the number of hidden layers in our NN? Shouldn’t this be a hyperparameter that is up to us to decide?

Hey all, posted also in the beginner forum but sharing here too

When running from fastai.vision.all import * from lesson 1 notebook I get the following error and not sure what to do. I tried downgrading scipy and numpy but didn’t seem to work (not sure if right approach either)

Can anyone help? :slight_smile:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/ipykernel_36/3449441972.py in <cell line: 0>()
      3 download_url(urls[0], dest, show_progress=False)
      4 
----> 5 from fastai.vision.all import *
      6 im = Image.open(dest)
      7 im.to_thumb(256,256)

/usr/local/lib/python3.11/dist-packages/fastai/vision/all.py in <module>
----> 1 from . import models
      2 from ..basics import *
      3 from ..callback.all import *
      4 from .augment import *
      5 from .core import *

/usr/local/lib/python3.11/dist-packages/fastai/vision/models/__init__.py in <module>
----> 1 from . import xresnet
      2 from . import unet
      3 from .tvm import *

/usr/local/lib/python3.11/dist-packages/fastai/vision/models/xresnet.py in <module>
      5 # %% ../../../nbs/11_vision.models.xresnet.ipynb 2
      6 from __future__ import annotations
----> 7 from ...torch_basics import *
      8 try: from torchvision.models.utils import load_state_dict_from_url
      9 except ModuleNotFoundError: from torch.hub import load_state_dict_from_url

/usr/local/lib/python3.11/dist-packages/fastai/torch_basics.py in <module>
      7     os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
      8 
----> 9 from .imports import *
     10 from .torch_imports import *
     11 from .torch_core import *

/usr/local/lib/python3.11/dist-packages/fastai/imports.py in <module>
     28 from plum import dispatch
     29 from numpy import array,ndarray
---> 30 from scipy import ndimage
     31 from pdb import set_trace
     32 from fastcore.all import *

/usr/lib/python3.11/importlib/_bootstrap.py in _handle_fromlist(module, fromlist, import_, recursive)

/usr/local/lib/python3.11/dist-packages/scipy/__init__.py in __getattr__(name)
    132 def __getattr__(name):
    133     if name in submodules:
--> 134         return _importlib.import_module(f'scipy.{name}')
    135     else:
    136         try:

/usr/lib/python3.11/importlib/__init__.py in import_module(name, package)
    124                 break
    125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
    127 
    128 

/usr/local/lib/python3.11/dist-packages/scipy/ndimage/__init__.py in <module>
    154 # mypy: ignore-errors
    155 
--> 156 from ._support_alternative_backends import *
    157 
    158 # adjust __all__ and do not leak implementation details

/usr/local/lib/python3.11/dist-packages/scipy/ndimage/_support_alternative_backends.py in <module>
      5 
      6 import numpy as np
----> 7 from ._ndimage_api import *   # noqa: F403
      8 from . import _ndimage_api
      9 from . import _delegators

/usr/local/lib/python3.11/dist-packages/scipy/ndimage/_ndimage_api.py in <module>
      9 from ._filters import *    # noqa: F403
     10 from ._fourier import *   # noqa: F403
---> 11 from ._interpolation import *   # noqa: F403
     12 from ._measurements import *   # noqa: F403
     13 from ._morphology import *   # noqa: F403

/usr/local/lib/python3.11/dist-packages/scipy/ndimage/_interpolation.py in <module>
     35 from scipy._lib._util import normalize_axis_index
     36 
---> 37 from scipy import special
     38 from . import _ni_support
     39 from . import _nd_image

/usr/lib/python3.11/importlib/_bootstrap.py in _handle_fromlist(module, fromlist, import_, recursive)

/usr/local/lib/python3.11/dist-packages/scipy/__init__.py in __getattr__(name)
    132 def __getattr__(name):
    133     if name in submodules:
--> 134         return _importlib.import_module(f'scipy.{name}')
    135     else:
    136         try:

/usr/lib/python3.11/importlib/__init__.py in import_module(name, package)
    124                 break
    125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
    127 
    128 

/usr/local/lib/python3.11/dist-packages/scipy/special/__init__.py in <module>
    824     chdtr, chdtrc, betainc, betaincc, stdtr)
    825 
--> 826 from . import _basic
    827 from ._basic import *
    828 

/usr/local/lib/python3.11/dist-packages/scipy/special/_basic.py in <module>
     20 from . import _specfun
     21 from ._comb import _comb_int
---> 22 from ._multiufuncs import (assoc_legendre_p_all,
     23                            legendre_p_all)
     24 from scipy._lib.deprecation import _deprecated

/usr/local/lib/python3.11/dist-packages/scipy/special/_multiufuncs.py in <module>
    140 
    141 
--> 142 sph_legendre_p = MultiUFunc(
    143     sph_legendre_p,
    144     r"""sph_legendre_p(n, m, theta, *, diff_n=0)

/usr/local/lib/python3.11/dist-packages/scipy/special/_multiufuncs.py in __init__(self, ufunc_or_ufuncs, doc, force_complex_output, **default_kwargs)
     39             for ufunc in ufuncs_iter:
     40                 if not isinstance(ufunc, np.ufunc):
---> 41                     raise ValueError("All ufuncs must have type `numpy.ufunc`."
     42                                      f" Received {ufunc_or_ufuncs}")
     43                 seen_input_types.add(frozenset(x.split("->")[0] for x in ufunc.types))

ValueError: All ufuncs must have type `numpy.ufunc`. Received (<ufunc 'sph_legendre_p'>, <ufunc 'sph_legendre_p'>, <ufunc 'sph_legendre_p'>)

Hey there, had the same error. Seems to be a compatibility issue with the version of NumPy that gets downloaded and installed. Looks like the fastai library (and dependencies) were compiled against NumPy 1.x

What fixed it for me was adding !pip install “numpy<2” to the section of code that installs the libraries. Hope this clears it up for you!

I fine-tuned a resnet34 Model using the specifications of the “is it a bird?” code, for predicting 6 main subject-matters in paitings. For each subject-matter I used about 100 paintings for training. My valid_loss is not satisfactory, but it works fairly well with the test data.

Hi learners! I just wanted to share a video and notebook I made that should help resolve some of the things that have changed since the course was filmed in 2022. It also has an alternative inference method that works on non-linux platforms.

Thanks!
Unfortunately I still get the error

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.6 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.11/dist-packages/colab_kernel_launcher.py", line 37, in <module>
    ColabKernelApp.launch_instance()
  File "/usr/local/lib/python3.11/dist-packages/traitlets/config/application.py", line 992, in launch_instance
    app.start()
  File "/usr/local/lib/python3.11/dist-packages/ipykernel/kernelapp.py", line 712, in start
    self.io_loop.start()
  File "/usr/local/lib/python3.11/dist-packages/tornado/platform/asyncio.py", line 211, in start
    self.asyncio_loop.run_forever()
  File "/usr/lib/python3.11/asyncio/base_events.py", line 608, in run_forever
    self._run_once()
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1936, in _run_once
    handle._run()
  File "/usr/lib/python3.11/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.11/dist-packages/ipykernel/kernelbase.py", line 510, in dispatch_queue
    await self.process_one()
  File "/usr/local/lib/python3.11/dist-packages/ipykernel/kernelbase.py", line 499, in process_one
    await dispatch(*args)
  File "/usr/local/lib/python3.11/dist-packages/ipykernel/kernelbase.py", line 406, in dispatch_shell
    await result
  File "/usr/local/lib/python3.11/dist-packages/ipykernel/kernelbase.py", line 730, in execute_request
    reply_content = await reply_content
  File "/usr/local/lib/python3.11/dist-packages/ipykernel/ipkernel.py", line 383, in do_execute
    res = shell.run_cell(
  File "/usr/local/lib/python3.11/dist-packages/ipykernel/zmqshell.py", line 528, in run_cell
    return super().run_cell(*args, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/IPython/core/interactiveshell.py", line 2975, in run_cell
    result = self._run_cell(
  File "/usr/local/lib/python3.11/dist-packages/IPython/core/interactiveshell.py", line 3030, in _run_cell
    return runner(coro)
  File "/usr/local/lib/python3.11/dist-packages/IPython/core/async_helpers.py", line 78, in _pseudo_sync_runner
    coro.send(None)
  File "/usr/local/lib/python3.11/dist-packages/IPython/core/interactiveshell.py", line 3257, in run_cell_async
    has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
  File "/usr/local/lib/python3.11/dist-packages/IPython/core/interactiveshell.py", line 3473, in run_ast_nodes
    if (await self.run_code(code, result,  async_=asy)):
  File "/usr/local/lib/python3.11/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "/tmp/ipykernel_96/2849907256.py", line 6, in <cell line: 0>
    from fastai.vision.all import *
  File "/usr/local/lib/python3.11/dist-packages/fastai/vision/all.py", line 1, in <module>
    from . import models
  File "/usr/local/lib/python3.11/dist-packages/fastai/vision/models/__init__.py", line 1, in <module>
    from . import xresnet
  File "/usr/local/lib/python3.11/dist-packages/fastai/vision/models/xresnet.py", line 7, in <module>
    from ...torch_basics import *
  File "/usr/local/lib/python3.11/dist-packages/fastai/torch_basics.py", line 9, in <module>
    from .imports import *
  File "/usr/local/lib/python3.11/dist-packages/fastai/imports.py", line 5, in <module>
    import multiprocessing,threading,urllib,tempfile,concurrent.futures,matplotlib,warnings,zipfile
  File "/usr/local/lib/python3.11/dist-packages/matplotlib/__init__.py", line 129, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "/usr/local/lib/python3.11/dist-packages/matplotlib/rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "/usr/local/lib/python3.11/dist-packages/matplotlib/colors.py", line 56, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "/usr/local/lib/python3.11/dist-packages/matplotlib/scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "/usr/local/lib/python3.11/dist-packages/matplotlib/ticker.py", line 138, in <module>
    from matplotlib import transforms as mtransforms
  File "/usr/local/lib/python3.11/dist-packages/matplotlib/transforms.py", line 49, in <module>
    from matplotlib._path import (
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
AttributeError: _ARRAY_API not found
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/tmp/ipykernel_96/2849907256.py in <cell line: 0>()
      4 download_url(urls[0], dest, show_progress=False)
      5 
----> 6 from fastai.vision.all import *
      7 
      8 im = Image.open(dest)

/usr/local/lib/python3.11/dist-packages/fastai/vision/all.py in <module>
----> 1 from . import models
      2 from ..basics import *
      3 from ..callback.all import *
      4 from .augment import *
      5 from .core import *

/usr/local/lib/python3.11/dist-packages/fastai/vision/models/__init__.py in <module>
----> 1 from . import xresnet
      2 from . import unet
      3 from .tvm import *

/usr/local/lib/python3.11/dist-packages/fastai/vision/models/xresnet.py in <module>
      5 # %% ../../../nbs/11_vision.models.xresnet.ipynb 2
      6 from __future__ import annotations
----> 7 from ...torch_basics import *
      8 try: from torchvision.models.utils import load_state_dict_from_url
      9 except ModuleNotFoundError: from torch.hub import load_state_dict_from_url

/usr/local/lib/python3.11/dist-packages/fastai/torch_basics.py in <module>
      7     os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
      8 
----> 9 from .imports import *
     10 from .torch_imports import *
     11 from .torch_core import *

/usr/local/lib/python3.11/dist-packages/fastai/imports.py in <module>
      3 import io,operator,sys,os,re,mimetypes,csv,itertools,json,shutil,glob,pickle,tarfile,collections
      4 import hashlib,itertools,types,inspect,functools,random,time,math,bz2,typing,numbers,string
----> 5 import multiprocessing,threading,urllib,tempfile,concurrent.futures,matplotlib,warnings,zipfile
      6 
      7 from concurrent.futures import as_completed

/usr/local/lib/python3.11/dist-packages/matplotlib/__init__.py in <module>
    127 # cbook must import matplotlib only within function
    128 # definitions, so it is safe to import from it here.
--> 129 from . import _api, _version, cbook, _docstring, rcsetup
    130 from matplotlib.cbook import sanitize_sequence
    131 from matplotlib._api import MatplotlibDeprecationWarning

/usr/local/lib/python3.11/dist-packages/matplotlib/rcsetup.py in <module>
     25 from matplotlib import _api, cbook
     26 from matplotlib.cbook import ls_mapper
---> 27 from matplotlib.colors import Colormap, is_color_like
     28 from matplotlib._fontconfig_pattern import parse_fontconfig_pattern
     29 from matplotlib._enums import JoinStyle, CapStyle

/usr/local/lib/python3.11/dist-packages/matplotlib/colors.py in <module>
     54 import matplotlib as mpl
     55 import numpy as np
---> 56 from matplotlib import _api, _cm, cbook, scale
     57 from ._color_data import BASE_COLORS, TABLEAU_COLORS, CSS4_COLORS, XKCD_COLORS
     58 

/usr/local/lib/python3.11/dist-packages/matplotlib/scale.py in <module>
     20 import matplotlib as mpl
     21 from matplotlib import _api, _docstring
---> 22 from matplotlib.ticker import (
     23     NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter,
     24     NullLocator, LogLocator, AutoLocator, AutoMinorLocator,

/usr/local/lib/python3.11/dist-packages/matplotlib/ticker.py in <module>
    136 import matplotlib as mpl
    137 from matplotlib import _api, cbook
--> 138 from matplotlib import transforms as mtransforms
    139 
    140 _log = logging.getLogger(__name__)

/usr/local/lib/python3.11/dist-packages/matplotlib/transforms.py in <module>
     47 
     48 from matplotlib import _api
---> 49 from matplotlib._path import (
     50     affine_transform, count_bboxes_overlapping_bbox, update_path_extents)
     51 from .path import Path

ImportError: numpy.core.multiarray failed to import

But it successfully installs numpy 1.26 it seems

Collecting numpy<2
  Using cached numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
Using cached numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 2.3.2
    Uninstalling numpy-2.3.2:
      Successfully uninstalled numpy-2.3.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.
bigframes 2.8.0 requires google-cloud-bigquery-storage<3.0.0,>=2.30.0, which is not installed.
gensim 4.3.3 requires scipy<1.14.0,>=1.7.0, but you have scipy 1.15.3 which is incompatible.
datasets 3.6.0 requires fsspec[http]<=2025.3.0,>=2023.1.0, but you have fsspec 2025.5.1 which is incompatible.
onnx 1.18.0 requires protobuf>=4.25.1, but you have protobuf 3.20.3 which is incompatible.
cesium 0.12.4 requires numpy<3.0,>=2.0, but you have numpy 1.26.4 which is incompatible.
google-colab 1.0.0 requires google-auth==2.38.0, but you have google-auth 2.40.3 which is incompatible.
google-colab 1.0.0 requires notebook==6.5.7, but you have notebook 6.5.4 which is incompatible.
google-colab 1.0.0 requires pandas==2.2.2, but you have pandas 2.2.3 which is incompatible.
google-colab 1.0.0 requires requests==2.32.3, but you have requests 2.32.4 which is incompatible.
google-colab 1.0.0 requires tornado==6.4.2, but you have tornado 6.5.1 which is incompatible.
dopamine-rl 4.1.2 requires gymnasium>=1.0.0, but you have gymnasium 0.29.0 which is incompatible.
pandas-gbq 0.29.1 requires google-api-core<3.0.0,>=2.10.2, but you have google-api-core 1.34.1 which is incompatible.
thinc 8.3.6 requires numpy<3.0.0,>=2.0.0, but you have numpy 1.26.4 which is incompatible.
imbalanced-learn 0.13.0 requires scikit-learn<2,>=1.3.2, but you have scikit-learn 1.2.2 which is incompatible.
plotnine 0.14.5 requires matplotlib>=3.8.0, but you have matplotlib 3.7.2 which is incompatible.
bigframes 2.8.0 requires google-cloud-bigquery[bqstorage,pandas]>=3.31.0, but you have google-cloud-bigquery 3.25.0 which is incompatible.
bigframes 2.8.0 requires rich<14,>=12.4.4, but you have rich 14.0.0 which is incompatible.
mlxtend 0.23.4 requires scikit-learn>=1.3.1, but you have scikit-learn 1.2.2 which is incompatible.
Successfully installed numpy-1.26.4

Ah I watched @masynthetic video and changing it to !pip install “numpy<2.0” “scipy” “fastai” --upgrade -q did the trick! Thanks both!

1 Like

A possible fix for the latest version of the duck duck go API python - DuckDuckGo search error when using FastAPI's pip version - Stack Overflow