I want to load MNIST data using fastAi datablock API on kaggle. The data is in csv format and not the normal image files.
When I try to load it gives the following error:
Could not do one pass in your dataloader, there is something wrong in it
Here is my code:
train_csv = pd.read_csv(path/'train.csv')
test_csv = pd.read_csv(path/'test.csv')
datablock = DataBlock(get_x = lambda r : r.iloc[:1:],
get_y = lambda r : r['label'])
dls = datablock.dataloaders(train_csv)
Other similar questions on the forum use fastAi V1 and I couldn’t find those functions in the documentation.
Also, most of the solutions involve first saving the files as image and then using the datablock API, however I think this will be slow, is there a way to directly use the csv file ?