application_vnd.jupyter.stderr_output_1.png
from torch import nn

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import torchvision

from torch import nn
from fastai.vision import *
import torchvision
df = pd.read_csv('../input/train.csv')
path = '../input'
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
model = torchvision.models.resnext101_32x8d(pretrained=True)
iB = ImageDataBunch.from_df(path=path, df=df, folder='train_images', seed=42, suffix='.png', test='test_images', size=224, bs=32, ds_tfms=get_transforms(do_flip=True, max_warp=0, max_rotate=0, max_lighting=0, p_affine=0, xtra_tfms=[crop_pad()]))
model1 = torchvision.models.resnext101_32x8d(pretrained=True)
model1.fc = nn.Sequential(nn.BatchNorm1d(2048), nn.Dropout(p=0.25), nn.Linear(2048, 512), nn.ReLU(), nn.BatchNorm1d(512), nn.Dropout(p=0.5), nn.Linear(512, 5))
model1.to(device)
learn1 = Learner(data=iB, model=model1, model_dir='/tmp/models', metrics=[accuracy])
learn2 = cnn_learner(data=iB, base_arch=models.resnet152, model_dir='/tmp/models', metrics=[accuracy])
learn3 = cnn_learner(data=iB, base_arch=models.densenet201, model_dir='/tmp/models', metrics=[accuracy])
learn4 = cnn_learner(data=iB, base_arch=models.vgg16_bn, model_dir='/tmp/models', metrics=[accuracy])