Views
No views yet
best_model.pth - Best performing checkpoint (93.09% accuracy)final_model.pth - Final model after all epochscheckpoint_epoch_X.pth - Saved every 50 epochs1import torch
2from torchvision import models
3
4# Load model
5model = models.resnet18(weights=None)
6model.fc = torch.nn.Linear(model.fc.in_features, 10)
7
8# Load trained weights
9checkpoint = torch.load('best_model.pth')
10model.load_state_dict(checkpoint['model_state_dict'])
11model.eval()