Is it possible to train and validate the model with data loaded from folder as png images (ImageList.from_folder()), but then do testing (inference) with completely different source (which retains the same image format/size/normalization)?
Longer version:
I am implementing a model for Kaggle MNIST competition. The data there is provided as pixel arrays in csv file. This is a custom format which is not supported by Fast.ai. Therefore, I’ve converted given data into actual png files in corresponding “training”, “validation” folders and then loaded them simply using ImageList.from_folder(…).
All goes well, the model gets trained. But when I want to test my trained model, I’d like to use csv format (as provided in Kaggle MNIST competition) instead of converting testing data into png files. Is that possible without additional programming?
When trying to load test dataset using MyCustomCsvImageList(ImageList).from_df(some_test_images.csv) I get error similar to this: “FileNotFoundError: [Errno 2] No such file or directory: ‘./0’”. From the error looks like the code still wants to load data as it were png files, but what I want is to load data from that given pixel data from csv.
This is how I try it:
learn.data.add_test(PixelImageItemList.from_df(…some required params…))
from_df here is my custom implementation which works perfectly fine to load csv data for train and validation sets.
So, this problem makes me wonder, is it just me or is there some buggy behavior in Fastai lib preventing the usage of different kind of input data sources?