Spaces:
Sleeping
Sleeping
fix torch import
Browse files
app.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import timm
|
| 3 |
-
|
| 4 |
|
| 5 |
model = timm.create_model("mobileone_s2", pretrained = False)
|
| 6 |
-
model.head.fc = 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 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import timm
|
| 3 |
+
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 |
|