from fastai.vision import * # Quick access to computer vision functionality path = untar_data(URLs.MNIST_SAMPLE) path data = ImageDataBunch.from_folder(path, ds_tfms=(rand_pad(2, 28), []), bs=64) data.normalize(imagenet_stats) img,label = data.train_ds[0] img learn = cnn_learner(data, models.resnet18, metrics=accuracy) learn.fit_one_cycle(1, 0.01) accuracy(*learn.get_preds()) data = ImageDataBunch.from_csv(path, ds_tfms=(rand_pad(2, 28), []), bs=64) data.normalize(imagenet_stats) img,label = data.train_ds[0] img learn = cnn_learner(data, models.resnet18, metrics=accuracy) learn.fit_one_cycle(1, 0.01)