%reload_ext autoreload %autoreload 2 from fastai import * from fastai.vision import * path = untar_data(URLs.DOGS) path data = ImageDataBunch.from_folder(path, ds_tfms=get_transforms(), tfms=imagenet_norm, size=224) img,label = data.valid_ds[-1] img.show(title=data.classes[label]) learn = ConvLearner(data, models.resnet34, metrics=accuracy) learn.fit_one_cycle(1) learn.unfreeze() learn.fit_one_cycle(6, slice(1e-5,3e-4), pct_start=0.05) accuracy(*learn.TTA()) learn = ConvLearner(data, models.resnet50, metrics=accuracy) learn.fit_one_cycle(6) learn.unfreeze() learn.fit_one_cycle(6, slice(1e-5,3e-4), pct_start=0.05) accuracy(*learn.TTA())