Spaces:
Sleeping
Sleeping
model file updated
#1
by
sawandarekar
- opened
model.py
CHANGED
@@ -1,5 +1,12 @@
|
|
|
|
1 |
import torch.nn as nn
|
2 |
import torchvision.models as models
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
class ResNet50(nn.Module):
|
5 |
def __init__(self, num_classes):
|
|
|
1 |
+
import torch
|
2 |
import torch.nn as nn
|
3 |
import torchvision.models as models
|
4 |
+
import torch.nn.functional as F
|
5 |
+
|
6 |
+
def get_resnet50(num_classes):
|
7 |
+
model = models.resnet50(weights=None)
|
8 |
+
model.fc = nn.Linear(model.fc.in_features, num_classes)
|
9 |
+
return model
|
10 |
|
11 |
class ResNet50(nn.Module):
|
12 |
def __init__(self, num_classes):
|