Skip to content

Commit 3db92b8

Browse files
fixing errors on mac by using cpu in get_masks_torch and torch.float in _extend_centers_gpu (#1034, #1063, #1097)
1 parent 3a325aa commit 3db92b8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cellpose/dynamics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,8 @@ def compute_masks(dP, cellprob, p=None, niter=200, cellprob_threshold=0.0,
911911
else:
912912
p_final = p_final.int()
913913
# calculate masks
914+
if device.type == "mps":
915+
p_final = p_final.to(torch.device("cpu"))
914916
mask = get_masks_torch(p_final, inds, dP.shape[1:],
915917
max_size_fraction=max_size_fraction)
916918
del p_final

0 commit comments

Comments
 (0)