Spaces:
Runtime error
Runtime error
map location cpu
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
11 |
#intialize the model
|
12 |
model = models.model(pretrained=False, requires_grad=False).to(device)
|
13 |
# load the model checkpoint
|
14 |
-
checkpoint = torch.load('model.pth')
|
15 |
# load model weights state_dict
|
16 |
model.load_state_dict(checkpoint['model_state_dict'])
|
17 |
model.eval()
|
|
|
11 |
#intialize the model
|
12 |
model = models.model(pretrained=False, requires_grad=False).to(device)
|
13 |
# load the model checkpoint
|
14 |
+
checkpoint = torch.load('model.pth', map_location=device)
|
15 |
# load model weights state_dict
|
16 |
model.load_state_dict(checkpoint['model_state_dict'])
|
17 |
model.eval()
|