Why Colab notebook for Lesson 2 works on Dogs&Cats code and in book and video lecture it is about Bears? Where to find Bear Colab notebook? Thank you
Thank you for this course; I’m having a lot of fun ![]()
I have made a small app for learning the Georgian alphabet. I tried several ways to gather data for tuning my model. At first I gathered images from the internet like in the lesson, then I used this dataset kaggle/datasets/kipshidze/georgian-handwritten-letters-dataset/data plus my handwriting, but the accuracy still isn’t good. I wonder what else I can do to improve my model. I will keep working on it.
The bears are in here: fastbook/02_production.ipynb at master · fastai/fastbook · GitHub
The whole book is in that fastbook repo.
Study group, anyone? I’m here in 2025 looking for fastai accountabilibuddies.
I keep starting this course, even bought the O’Reilly book, but I keep getting distracted before I make it to like lesson 4. Hit me up, boscacci@proton.me. Maybe we could do weekly check-ins to discuss course topics and demo each other’s homework / projects.
Hello. I’m trying to follow along with deploying my Dog/Cat classifier on HuggingFace. But when I push my app.py to HF, it fails with this error:
UserWarning: load_learner uses Python’s insecure pickle module, which can execute malicious arbitrary code when loading. Only load files you trust.
If you only need to load model weights and optimizer state, use the safe Learner.load instead.
warn("load_learner uses Python's insecure pickle module, which can execute malicious arbitrary code when loading.
Is there a way to whitelist my app or model? I can’t find any documentation on replacing load_learner with Learner.load either. I’ve seen the docs describing Learner.load but it seems to be a different sort of function than learner_load.
Please can anyone point me to a way to get this up and running? It seems like an immensely critical and basic function to straight up not work any more!
I faced this issue as well. You can try to check my version with images as input (now I have base64 images). I’m a beginner in Python, so I used ChatGPT and DeepSeek for debugging. ChatGPT and DeepSeek are very helpful.
Thanks for the reply. I tried adding all the imports you have (essentially the only lines that are different in my file) but am still having the issue.
Could you share what’s in your requirements.txt ? Maybe it’s something in there?
Also I noticed this part of the error this time, perhaps I need to do something different with versions?
RuntimeError: Loading model fname='model.pkl', attempted to import from `fastcore.dispatch` and/or `fastcore.transform` which are deprecated in `fastai>=2.8.0`.
Downgrade to `fastai<2.8.0` if you want to load this model.
For anyone here after me, the issue did turn out to be the fastai version. Which could be resolved by using this as my requirements.txt
fastai==2.7.12
torch<2.2
torchvision<0.16
numpy<2.0
gradio
runtime error
Exit code: 1. Reason: Traceback (most recent call last):
File “/home/user/app/app.py”, line 12, in
learn = load_learner(“trash_classifier.pkl”)
File “/usr/local/lib/python3.10/site-packages/fastai/learner.py”, line 446, in load_learner
try: res = torch.load(fname, map_location=map_loc, pickle_module=pickle_module)
File “/usr/local/lib/python3.10/site-packages/torch/serialization.py”, line 809, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File “/usr/local/lib/python3.10/site-packages/torch/serialization.py”, line 1172, in _load
result = unpickler.load()
TypeError: code expected at most 16 arguments, got 18
requirements.txt file
fastai==2.7.12
torch<2.2
torchvision<0.16
numpy<2.0
gradio
fasttransform
cloudpickle
can anyone help me to solve this issue??
Hi @mdfaisal, In Python 3.11, CodeType got two new constructor parameters; pickles produced there now carry 18 args, but CPython 3.10’s CodeType only accepts 16. Hugging Space as a default runs 3.10. The solution is to specify to Hugging Space in the YALM section of the readme what Python to use: —
title: My Space
emoji: ![]()
colorFrom: blue
colorTo: red
sdk: gradio
python_version: 3.11
Hello, I have the exact same error message.
Also looking for help!
I solved my issue by following the updated version of the Gradio tutorial that was advertised by Hafiz Ahmad Hassan: Update in Tanishq Blog Gradio
Thanks Hafiz!
you welcome
“Bing search image” api doesn’t work anymore. It’s being officially retired starting from August, and it no longer supports the api deployment.
In the notebook of lesson-2, it is still using that, and I was wondering if there’s an alternative to that? Thanks.
Hello people of FastAI. Am a new deep learner. Can any of the learners help me in a query?
If i work in kaggle and simply write down:
!pip install -Uqq fastai
and then call the download_images function like this below:
from fastai.vision.utils import download_images
I get an error which looks like as follows:
but when i run the same 2 lines in colab, it works fine and no error. can someone explain what is happening? is there something i am doing wrong? i want to use the download_images() function like the professor is teaching for the grizzly bear lecture.
I faced the same issue when using kaggle to run my notebooks.
The solution is to switch to google colab.
this helped me out..if anyone isnterested…
the link for the 3rd lesson doesn’t work
There is no lesson 3 official topic
This is fixed. It was deleted but I’m not sure how. Probably accidentally when we were cleaning up the forums
