Spaces:
Running
Running
fix:load model in cpu
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ def predict(numpy_img):
|
|
| 21 |
#choose model class hr_w32
|
| 22 |
model=hr_w32().to(device)
|
| 23 |
#load weights of model
|
| 24 |
-
model.load_state_dict(torch.load('./weights/HRNet_epoch20_loss0.000474.pth')['model'])
|
| 25 |
# #set model to pred state
|
| 26 |
model.eval()
|
| 27 |
# #predict the heatmaps of joints
|
|
|
|
| 21 |
#choose model class hr_w32
|
| 22 |
model=hr_w32().to(device)
|
| 23 |
#load weights of model
|
| 24 |
+
model.load_state_dict(torch.load('./weights/HRNet_epoch20_loss0.000474.pth',map_location=torch.device('cpu'))['model'])
|
| 25 |
# #set model to pred state
|
| 26 |
model.eval()
|
| 27 |
# #predict the heatmaps of joints
|