here is the problem am facing from almost 10 days but got no solution till now.
First I tried to create a model using MNIST_TINY dataset and I used ImageList for creating databunch. it worked fine and model was ready. i noticed that this dataset had three subfolders train,test and labels.csv.
now I tried it with MNIST dataset and when i try to create databunch using ImageList it shows a warning saying “training dataset is empty, valid dataset is empty” and
error-- “index 0 is out of bound for axis 0 and size 0:
exception-” Can’t infer the type of your targets.
It’s either because your data source is empty or because your labelling function raised an error."
i have also tried with ImageDataBunch but got same error.
The DataBlock API should be your go-to solution for almost anything.
It covers a lot of the most common use cases. Here another very detailed tutorial, which also contains a MNIST example.
It works on MNIST_TINY but shows error in MNIST which has all classes from 0 to 9. That’s what i am saying.
And it is fastai v2. Is there any solution using fastai v1 or it is a bug?
You are right. I did not notice.
For it to work you just have to fix the GrandparentSplitter, e.g. use splitter=GrandparentSplitter(train_name='training', valid_name='testing')
This is due to the fact that GrandparentSplitter's default train_name and valid_name are respectively train and valid. But if you look into MNIST’s path (using path.ls()) you would see that the folders are named differently (training and testing respectively).