The reason you are unable to use ImageDataBunch is because this is something that was available in the previous version of Fastai (v1), but has been replaced with ImageDataLoaders.from_folder – you can find the documentation here: fastai - Vision data
I just have a quick question regarding the training model. After loading the data as you guided. would that be fine if I use the following snippet or this one is deprecated? Would be grateful if you please guide me. Thanks
learn = cnn_learner(data, models.resnet18, metrics=accuracy, pretrained=False)
learn.fit(5) # Train for 5 epochs (passes through all of the training data)