CPU
Browse files
model.py
CHANGED
@@ -156,7 +156,8 @@ class FoundModel(nn.Module):
|
|
156 |
def decoder_load_weights(self, weights_path):
|
157 |
print(f"Loading model from weights {weights_path}.")
|
158 |
# Load states
|
159 |
-
|
|
|
160 |
|
161 |
# Decoder
|
162 |
self.decoder.load_state_dict(state_dict["decoder"])
|
|
|
156 |
def decoder_load_weights(self, weights_path):
|
157 |
print(f"Loading model from weights {weights_path}.")
|
158 |
# Load states
|
159 |
+
map_location=torch.device('cpu')
|
160 |
+
state_dict = torch.load(weights_path, map_location=map_location)
|
161 |
|
162 |
# Decoder
|
163 |
self.decoder.load_state_dict(state_dict["decoder"])
|