update code for cpu load
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ vgg16.classifier[6] = torch.nn.Linear(num_features, num_classes)
|
|
18 |
|
19 |
# Load the model
|
20 |
model = vgg16
|
21 |
-
state_dict = torch.load('vgg16_transfer_learning.pth')
|
22 |
model.load_state_dict(state_dict)
|
23 |
model.eval()
|
24 |
|
|
|
18 |
|
19 |
# Load the model
|
20 |
model = vgg16
|
21 |
+
state_dict = torch.load('vgg16_transfer_learning.pth', map_location=torch.device('cpu'))
|
22 |
model.load_state_dict(state_dict)
|
23 |
model.eval()
|
24 |
|