Skip to content

Commit

Permalink
load model onto cpu first to avoid mps error on linux (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
alisterburt authored May 12, 2023
1 parent ac14536 commit 3b1b4f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fidder/model/_tests/test_download_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
def test_download_and_load_latest_checkpoint():
checkpoint_file = get_latest_checkpoint()
model = Fidder()
model.load_from_checkpoint(checkpoint_file)
model.load_from_checkpoint(checkpoint_file, map_location="cpu")
assert isinstance(model, Fidder)
2 changes: 1 addition & 1 deletion src/fidder/predict/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def predict_fiducial_mask(
# prepare model
if model_checkpoint_file is None:
model_checkpoint_file = get_latest_checkpoint()
model = Fidder.load_from_checkpoint(model_checkpoint_file)
model = Fidder.load_from_checkpoint(model_checkpoint_file, map_location="cpu")
model.eval()

# predict
Expand Down

0 comments on commit 3b1b4f0

Please sign in to comment.