From d34d5f497a8dd5211107d6616181386e348d6ecc Mon Sep 17 00:00:00 2001 From: Michael Rariden Date: Fri, 22 Aug 2025 16:27:11 -0400 Subject: [PATCH 1/2] Allow specify gpu device number --- cellpose/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellpose/core.py b/cellpose/core.py index 0505f464..9fb93455 100644 --- a/cellpose/core.py +++ b/cellpose/core.py @@ -77,7 +77,7 @@ def assign_device(use_torch=True, gpu=False, device=0): if isinstance(device, str): if device != "mps" or not(gpu and torch.backends.mps.is_available()): device = int(device) - if gpu and use_gpu(use_torch=True): + if gpu and use_gpu(gpu_number=device, use_torch=True): try: if torch.cuda.is_available(): device = torch.device(f'cuda:{device}') From 61996b0d49d965eacf221dd4583ea1c1e6fa8e64 Mon Sep 17 00:00:00 2001 From: Michael Rariden Date: Fri, 26 Sep 2025 13:45:41 -0400 Subject: [PATCH 2/2] Fix use_gpu argument in assign_device function to respect use_torch parameter --- cellpose/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellpose/core.py b/cellpose/core.py index 9fb93455..f016bcde 100644 --- a/cellpose/core.py +++ b/cellpose/core.py @@ -77,7 +77,7 @@ def assign_device(use_torch=True, gpu=False, device=0): if isinstance(device, str): if device != "mps" or not(gpu and torch.backends.mps.is_available()): device = int(device) - if gpu and use_gpu(gpu_number=device, use_torch=True): + if gpu and use_gpu(gpu_number=device, use_torch=use_torch): try: if torch.cuda.is_available(): device = torch.device(f'cuda:{device}')