Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Morris committed Oct 1, 2024
1 parent 4f7e892 commit 5c5f55e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cyto_dl/utils/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def load_checkpoint(model, load_params):
"ckpt_path"
), "ckpt_path must be provided to with argument weights_only=True"
# load model from state dict to get around trainer.max_epochs limit, useful for resuming model training from existing weights
state_dict = torch.load(load_params["ckpt_path"], map_location='cpu')["state_dict"]
state_dict = torch.load(load_params["ckpt_path"], map_location="cpu")["state_dict"]
model.load_state_dict(state_dict, strict=load_params.get("strict", True))
# set ckpt_path to None to avoid loading checkpoint again with model.fit/model.test
load_params["ckpt_path"] = None
Expand Down

0 comments on commit 5c5f55e

Please sign in to comment.