Open sumitpowar opened 3 years ago
make sure you import * from fastbook image_cat is a function that returns a sample cat image built into the fast.ai lib
import fastbook
fastbook.setup_book()
from fastbook import *
thanks, venomoustoad!
I had the same issue. This one line: from fastbook import *
fixes NameError mentioned by sumitpowar above:
from fastbook import *
img1 = PILImage.create(image_cat())
img1.to_thumb(192)
The course page may benefit from this modification.
Best, PO
Still doesn't work. Neither does:
from fastai import *
Turns out that you can corrupt a Kaggle notebook with the wrong imports. Starting from scratch and this works:
! pip install -Uqq fastbook
import fastbook
fastbook.setup_book()
from fastbook import *
img = PILImage.create(image_cat())
img.to_thumb(192)
HI,
What is image_cat() in the following code (given in lesson 1)?
img = PILImage.create(image_cat()) img.to_thumb(192)
It gives following error after running it:
**NameError Traceback (most recent call last)