Skip to content

Commit

Permalink
Merge pull request #163 from JoOkuma/device-fix
Browse files Browse the repository at this point in the history
Using predictor device when setting image embedding
  • Loading branch information
constantinpape authored Aug 24, 2023
2 parents cad7c8f + 8a72e87 commit bf82e31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion micro_sam/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def set_precomputed(
i: Index for the image data. Required if `image` has three spatial dimensions
or a time dimension and two spatial dimensions.
"""
device = "cuda" if torch.cuda.is_available() else "cpu"
device = predictor.device
features = image_embeddings["features"]

assert features.ndim in (4, 5)
Expand Down

0 comments on commit bf82e31

Please sign in to comment.