text_plain_output_1.png image_output_1.png
base_dir = '../input/cell_images/cell_images/'
base_path = Path(base_dir)
base_path

data = ImageDataBunch.from_folder(base_path, valid_pct=0.1, train='.', ds_tfms=get_transforms(max_warp=0, flip_vert=True), size=128, bs=32, num_workers=0).normalize(imagenet_stats)

learner = create_cnn(data, models.resnet50, metrics=accuracy, model_dir='/tmp/model/')
learner.lr_find()

learner.fit_one_cycle(10, max_lr=slice(0.0001, 0.001))
learner.save('stage-1')

inter = ClassificationInterpretation.from_learner(learner)

learner.unfreeze()
learner.fit_one_cycle(2)

learner.lr_find()

learner.fit_one_cycle(5, max_lr=slice(1e-06, 0.001))

inter = ClassificationInterpretation.from_learner(learner)
inter.plot_top_losses(9, figsize=(20, 20))