try to fix mismatch
Browse files6 unmodified lines78910111213141516171819206 unmodified lines# 1. Define your model class# --------------------------# Make sure this matches the architecture you used to train your modelclass MyCarClassifier(torch.nn.Module):def __init__(self, num_classes=196): # Stanford Cars has 196 classessuper(MyCarClassifier, self).__init__()# Example: replace with your actual model architecturefrom torchvision.models import resnet50self.model = resnet50(pretrained=False)self.model.fc = torch.nn.Linear(self.model.fc.in_features, num_classes)def forward(self, x):return self.model(x)6 unmodified lines7891011121314151617181920216 unmodified lines# 1. Define your model class# --------------------------# Make sure this matches the architecture you used to train your modelfrom torchvision.models import resnet50class MyCarClassifier(torch.nn.Module):def __init__(self, num_classes=196):super(MyCarClassifier, self).__init__()self.model = resnet50(pretrained=False)in_ch = self.model.fc.in_featuresself.model.fc = torch.nn.Linear(in_ch, num_classes)def forward(self, x):return self.model(x)
app.py+6-5