text_plain_output_1.png
from torchvision import models

import torch.nn as nn

model_ft = models.resnet50(pretrained=True)

model_ft.fc.in_features

from collections import OrderedDict
fc = nn.Sequential(nn.Linear(model_ft.fc.in_features, 720), nn.ReLU(), nn.Dropout(0.5), nn.Linear(720, 256), nn.ReLU(), nn.Dropout(0.4), nn.Linear(256, 64), nn.ReLU(), nn.Dropout(0.3), nn.Linear(64, 5), nn.Softmax(dim=1))

model_ft.fc = fc

print(model_ft)