Commit
·
c9a01d9
1
Parent(s):
c77f67f
fix: gpu issue
Browse files- explain.py +1 -1
explain.py
CHANGED
@@ -132,7 +132,7 @@ def save_explanation_results(res, path):
|
|
132 |
|
133 |
|
134 |
model, image_transform = get_model(model_name)
|
135 |
-
model.load_state_dict(torch.load(model_path))
|
136 |
model.train()
|
137 |
target_layers = [model.conv_head]
|
138 |
gbp_model = GuidedBackpropReLUModel(model=model, device="cpu")
|
|
|
132 |
|
133 |
|
134 |
model, image_transform = get_model(model_name)
|
135 |
+
model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
|
136 |
model.train()
|
137 |
target_layers = [model.conv_head]
|
138 |
gbp_model = GuidedBackpropReLUModel(model=model, device="cpu")
|