I'm having trouble running this line of code in Deepnote, does anyone know why?
data = ImageDataBunch.from_folder(path, train="train", valid ="test",ds_tfms=get_transforms(), size=(256,256), bs=32, num_workers=4).normalize()
The error says:
NameError: name 'ImageDataBunch' is not defined
And previously, I have imported the Fastai library. So I don't get it!
The FastAI setup in Deepnote is not that straightforward. It's best to use a custom environment where you set stuff up in a
Dockerfile
and everything works afterwards in the notebook. I am not sure if theImageDataBunch
or whatever you're trying to do works the same way in FastAI v1 and v2, but here are the details for v1.This is a Dockerfile which sets up the FastAI environment via conda:
After that, you can test the
fastai
imports in the notebook:And if you download and unpack this sample MNIST dataset, you should be able to load the data like you suggested:
Feel free to check out or clone my Deepnote project to continue working on this.