Spaces:
Runtime error
Runtime error
carlosabadia
commited on
Commit
•
d107d05
1
Parent(s):
1b62743
fixed dict
Browse files- app.py +0 -8
- examples/pasta.jpg +0 -0
app.py
CHANGED
@@ -19,14 +19,6 @@ vit16, vit16_transforms = create_vit16_model(
|
|
19 |
)
|
20 |
|
21 |
|
22 |
-
state_dict = torch.load("model_food101_20_percent.pth")
|
23 |
-
state_dict["heads.0.weight"] = state_dict.pop("heads.weight")
|
24 |
-
state_dict["heads.0.bias"] = state_dict.pop("heads.bias")
|
25 |
-
# save new state_dict in .pth
|
26 |
-
torch.save(state_dict, "model_food101_20_percent.pth")
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
vit16.load_state_dict(
|
31 |
torch.load(
|
32 |
f="model_food101_20_percent.pth",
|
|
|
19 |
)
|
20 |
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
vit16.load_state_dict(
|
23 |
torch.load(
|
24 |
f="model_food101_20_percent.pth",
|
examples/pasta.jpg
CHANGED