mmek commited on
Commit
a516a70
·
1 Parent(s): db88d52

change model load

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -4,7 +4,7 @@ import torch
4
 
5
  model = timm.create_model("mobileone_s2", pretrained = False)
6
  model.head.fc = torch.nn.Linear(model.head.fc.in_features,3)
7
- model.load_state_dict(torch.load("olive-classifier.pth", weights_only=True))
8
  model.eval()
9
 
10
  categories = ("Aculus Olearius", "Healthy", "Peacock Spot")
 
4
 
5
  model = timm.create_model("mobileone_s2", pretrained = False)
6
  model.head.fc = torch.nn.Linear(model.head.fc.in_features,3)
7
+ model.load_state_dict(torch.load("olive-classifier.pth", map_location=torch.device('cpu'), weights_only=True))
8
  model.eval()
9
 
10
  categories = ("Aculus Olearius", "Healthy", "Peacock Spot")