Load image data from Numpy arrays with block.api

(Jeroen Vuurens) #1

I am trying to experiment on the entire MNIST dataset, not just a sample. The most convenient way to download and load the data seems to be:

import mnist
from sklearn.model_selection import train_test_split

X_train, X_valid, y_train, y_valid = train_test_split(mnist.train_labels(), mnist.train_labels(), test_size=1/6, random_state=42)

This gives me the images and labels in Numpy arrays. However, I would like to turn them into a DataBunch to use the image transformations. Googling showed that there used to be a from_arrays factory method, but it seems that is no longer supported in v1. Can anyone help me how to turn this into a DataBunch of images?

Thanks, Jeroen

1 Like

(Prince Jain) #2

did you find a solution to it yet… i know v2 version of fastai has imageClassifierData.fromarrays() which allows to do it but no such functionality exists now.