diff --git a/glmocr/layout/layout_detector.py b/glmocr/layout/layout_detector.py index 90617c3..e6b14f7 100644 --- a/glmocr/layout/layout_detector.py +++ b/glmocr/layout/layout_detector.py @@ -88,7 +88,7 @@ def start(self): # 2. Auto: cuda:{cuda_visible_devices} if CUDA available, else CPU if self._config_device is not None: self._device = self._config_device - elif torch.cuda.is_available() and self.cuda_visible_devices: + elif torch.cuda.is_available() and self.cuda_visible_devices and self.cuda_visible_devices != "cpu": self._device = f"cuda:{self.cuda_visible_devices}" else: self._device = "cpu"