Has ImageClassifierData been supersceded?


(Brian Law) #1

I can’t seem to find it mentioned anywhere anymore but I am trying to run some older fastai code that uses it?


(Philip Schlesinger) #2

I’m wondering the same thing. It was part of v0.7.0 but disappeared in v1. I’m now experimenting with the possibility it was replaced with ImageClassifierDataset


(Brian Law) #3

I found ImageClassifierData here: https://github.com/fastai/fastai/blob/v0.7.2/fastai/dataset.py

It’s still a wrapper for for DataLoader from PyTorch so might have to unravel how ImageClassifierData wraps up the data and see how that fits in with the new ImageClassificationDataset and databunch


(Philip Schlesinger) #4

Hi @data-drone – yeah no other class (in “old” or in the current 1.x version) wraps the DataLoader class.

I’m trying to complete the first Deep Learning lesson on Google Colab (dogs and cats). Getting stuck here:
arch=resnet34
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=True)
learn.fit(0.01, 2)

Yes the lessons were designed for fastai 0.7…but Google Collab’s python libraries conflict with the library version that fastai 0.7 wants to load. I’m an utter Python n00b…any suggestions on how to migrate that code to ImageClassificationDataset (and how you came to figure that out)?


(Duc Haba) #5

Philip:

How are you doing? Have you found the answer to do lesson one on Fastai version 1.x?

I am searching for the same answer.


(Muhammad Abubakar Waris) #6

If anyone have found the solution of Philip’s problem please help.


(George Zhang) #7

The closest equivalent of ImageClassifierData should be ImageDataBunch. from_paths are probably from_folder. tfms_from_model is deprecated; use get_transforms() instead.

ConvLearner is now cnn_learner.

To be honest, since the API of fastai library updates so fast, I would recommend you stick to the latest version of the course.