Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import numpy as np
|
|
4 |
import torchvision.models as models
|
5 |
from torchvision import transforms as T
|
6 |
|
|
|
7 |
new_model = models.resnet18()
|
8 |
num_ftrs = new_model.fc.in_features
|
9 |
new_model.fc = nn.Linear(num_ftrs, 75)
|
|
|
4 |
import torchvision.models as models
|
5 |
from torchvision import transforms as T
|
6 |
|
7 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
8 |
new_model = models.resnet18()
|
9 |
num_ftrs = new_model.fc.in_features
|
10 |
new_model.fc = nn.Linear(num_ftrs, 75)
|