Spaces:
Sleeping
Sleeping
bigmed@bigmed
commited on
Commit
·
edae4b7
1
Parent(s):
e0fd7bf
added load map location cpu
Browse files
app.py
CHANGED
@@ -113,7 +113,7 @@ def Final_Compute_regression_results_Sample(Model, batch_sampler,num_head=2):
|
|
113 |
#load model
|
114 |
DeepLab=Transformer_Regression(image_dim=image_shape,dim_patch=dim_patch,num_classes=3,scale=scale,feat_dim=128)
|
115 |
DeepLab.to(device=device)
|
116 |
-
DeepLab.load_state_dict(torch.load("TrainAll_Maghrabi84_50iteration_SWIN.pth.tar"))
|
117 |
|
118 |
def infer(img):
|
119 |
# img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
|
|
113 |
#load model
|
114 |
DeepLab=Transformer_Regression(image_dim=image_shape,dim_patch=dim_patch,num_classes=3,scale=scale,feat_dim=128)
|
115 |
DeepLab.to(device=device)
|
116 |
+
DeepLab.load_state_dict(torch.load("TrainAll_Maghrabi84_50iteration_SWIN.pth.tar", map_location=torch.device(device)))
|
117 |
|
118 |
def infer(img):
|
119 |
# img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|