Spaces:
Sleeping
Sleeping
File size: 306 Bytes
6276d4c | 1 2 3 4 5 6 7 8 9 10 11 12 13 | import torch.nn as nn
from torchvision import models
def build_resnet50(num_classes, dropout=0.3):
model = models.resnet50(weights=models.ResNet50_Weights.DEFAULT)
model.fc = nn.Sequential(
nn.Dropout(dropout),
nn.Linear(model.fc.in_features, num_classes)
)
return model |