Initial commit
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def load_model():
|
|
| 12 |
model = models.resnet18(weights=None)
|
| 13 |
num_ftrs = model.fc.in_features
|
| 14 |
model.fc = nn.Linear(num_ftrs, len(class_names))
|
| 15 |
-
model.load_state_dict(torch.load("
|
| 16 |
model.eval()
|
| 17 |
return model
|
| 18 |
|
|
|
|
| 12 |
model = models.resnet18(weights=None)
|
| 13 |
num_ftrs = model.fc.in_features
|
| 14 |
model.fc = nn.Linear(num_ftrs, len(class_names))
|
| 15 |
+
model.load_state_dict(torch.load("resnet_model.pth", map_location=torch.device("cpu")))
|
| 16 |
model.eval()
|
| 17 |
return model
|
| 18 |
|