Skip to content

Commit bf82e31

Browse files
Merge pull request #163 from JoOkuma/device-fix
Using predictor device when setting image embedding
2 parents cad7c8f + 8a72e87 commit bf82e31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

micro_sam/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def set_precomputed(
560560
i: Index for the image data. Required if `image` has three spatial dimensions
561561
or a time dimension and two spatial dimensions.
562562
"""
563-
device = "cuda" if torch.cuda.is_available() else "cpu"
563+
device = predictor.device
564564
features = image_embeddings["features"]
565565

566566
assert features.ndim in (4, 5)

0 commit comments

Comments
 (0)