Skip to content

Commit 91289ce

Browse files
authored
allow loading models to cpu
1 parent eeaed66 commit 91289ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intrinsic/model_util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def load_models(path, device='cuda'):
2222
iid_state_dict = torch.load(path[1])
2323
else:
2424
if path == 'paper_weights':
25-
combined_dict = torch.hub.load_state_dict_from_url('https://github.com/compphoto/Intrinsic/releases/download/v1.0/final_weights.pt', progress=False)
25+
combined_dict = torch.hub.load_state_dict_from_url('https://github.com/compphoto/Intrinsic/releases/download/v1.0/final_weights.pt', map_location=device, progress=True)
2626
elif path == 'rendered_only':
27-
combined_dict = torch.hub.load_state_dict_from_url('https://github.com/compphoto/Intrinsic/releases/download/v1.0/rendered_only_weights.pt', progress=False)
27+
combined_dict = torch.hub.load_state_dict_from_url('https://github.com/compphoto/Intrinsic/releases/download/v1.0/rendered_only_weights.pt', map_location=device, progress=True)
2828
else:
2929
combined_dict = torch.load(path)
3030

0 commit comments

Comments
 (0)