fengruilin commited on
Commit
86bf76b
·
verified ·
1 Parent(s): 5dc2dc5

trying again

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -23,7 +23,8 @@ class MyCarClassifier(torch.nn.Module):
23
  # 2. Load model weights
24
  # --------------------------
25
  model = MyCarClassifier()
26
- model.load_state_dict(torch.load("best_stanford_cars_transfer_model.pth", map_location="cpu"), strict=True)
 
27
  model.eval() # important for inference
28
 
29
  # --------------------------
 
23
  # 2. Load model weights
24
  # --------------------------
25
  model = MyCarClassifier()
26
+ state_dict = torch.load("best_stanford_cars_transfer_model.pth", map_location="cpu")
27
+ model.model.load_state_dict(state_dict, strict=True)
28
  model.eval() # important for inference
29
 
30
  # --------------------------