from fastai import * from fastai.vision import * from fastai.widgets import DatasetFormatter, ImageCleaner path = untar_data(URLs.MNIST_SAMPLE) data = ImageDataBunch.from_folder(path) learner = create_cnn(data, models.resnet18, metrics=[accuracy]) ds, idxs = DatasetFormatter().from_toplosses(learner, ds_type=DatasetType.Valid) ImageCleaner(ds, idxs)