Lesson 3 part 1 on colab

i try to make a databunch from the planet dataset following jeremy example in the lesson, it seems that i succeeded in downloading the planet dataset successfully but then i tried to make a databunch like the example in the lesson
and it produced an error that ImageFileList is not defined. i understood from the forum that ImageFileList is not in use any more and i read in the datablock api doc that imagelist is used instead.

but when i tried to use ImageList to create the data bunch like this:
np.random.seed(42)
src = (ImageList.from_folder(path)
.label_from_csv(‘train_v2.csv’,sep = ’ ', folder = ‘train-jpg’, suffix = ‘.jpg’)
.random_split_by_pct(0.2))
data = (src.datasets()
.transform(tfms, size = 128)
.databunch().normalize(imagenetstats))
i got another error:
AttributeError: ‘ImageList’ object has no attribute ‘label_from_csv’

i spent some time but i couldnt find information on that or solve this issue until now so any help will be appreciated
thanks a lot in advance
amotz

Hi Amotz,
After skimming thru the data_block source code, it seems like label_from_csv has been removed for some reason.

Actually, the notebook of Lesson3-part1 has been updated on the course github, you can check it out here. There is also the Look at data tutorial showing the preferred way to create a databunch object for the planet dataset.

Hope this helps,
Yiming

1 Like

thanks very much! i didn’t know about the updated notebooks, i will look at it today :).