hasnanmr commited on
Commit
d1d6890
·
1 Parent(s): 1976206

update code for cpu load

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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