add cpu load
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ def predict(img):
|
|
67 |
#model = SASNet().cuda()
|
68 |
model_path = "./SHHA.pth"
|
69 |
# load the trained model
|
70 |
-
model.load_state_dict(torch.load(model_path))
|
71 |
print('successfully load model from', model_path)
|
72 |
|
73 |
with torch.no_grad():
|
|
|
67 |
#model = SASNet().cuda()
|
68 |
model_path = "./SHHA.pth"
|
69 |
# load the trained model
|
70 |
+
model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
|
71 |
print('successfully load model from', model_path)
|
72 |
|
73 |
with torch.no_grad():
|