text_html_output_1.png
!pip install efficientnet_pytorch
from efficientnet_pytorch import EfficientNet
from torch import nn, optim
model_ft = EfficientNet.from_pretrained('efficientnet-b0', num_classes=len(class_names))
print("======== Fine-funing netowrk architecutre ========\n")
print(model_ft)
model_ft = model_ft.to(device)
criterion = nn.CrossEntropyLoss()
criterion = criterion.to(device)
optimizer = optim.SGD(model_ft.parameters(), lr=0.001, momentum=0.9)
scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=7, gamma=0.1)