yijiu commited on
Commit
44207e0
·
1 Parent(s): 6a5f391

fix:load model in cpu

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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