Skip to content

Commit

Permalink
load only weights
Browse files Browse the repository at this point in the history
  • Loading branch information
ninsbl committed Aug 8, 2024
1 parent 3f5b44c commit f5fc23a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/imagery/i.pytorch/pytorchlib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ def load_model(dl_model_path, dl_backbone, dl_kwargs, device="gpu"):
dl_model.load_state_dict(
torch.load(
str(dl_model_path),
weights_only=True,
)
)
else:
dl_model.load_state_dict(
torch.load(
str(dl_model_path),
weights_only=True,
map_location=torch.device("cpu"),
)
)
Expand Down

0 comments on commit f5fc23a

Please sign in to comment.