Spaces:
Sleeping
Sleeping
Commit ·
c4b1a94
1
Parent(s): 910b3f7
fixed loading of state dict
Browse files
app.py
CHANGED
|
@@ -6,7 +6,8 @@ from torchvision.transforms import Resize, ToTensor
|
|
| 6 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
| 7 |
|
| 8 |
model = torch.nn.Module()
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
resize = Resize((224))
|
| 12 |
to_tensor = ToTensor()
|
|
|
|
| 6 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
| 7 |
|
| 8 |
model = torch.nn.Module()
|
| 9 |
+
|
| 10 |
+
model.load_state_dict(torch.load('model.pt', map_location=device))
|
| 11 |
|
| 12 |
resize = Resize((224))
|
| 13 |
to_tensor = ToTensor()
|