Has ImageClassifierData been supersceded?

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

1 Like

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

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

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)?

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.

1 Like

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

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.

1 Like

The Data Block API might help:
https://docs.fast.ai/data_block.html