From 5549ead840a84bbacb2ecf76c5fd95f34045c231 Mon Sep 17 00:00:00 2001 From: Fabian Isensee Date: Tue, 28 May 2024 09:40:44 +0200 Subject: [PATCH] fix #2219 by disabling torch.compile if the device is CPU --- nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py b/nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py index 15b26917c..4c179f172 100644 --- a/nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py +++ b/nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py @@ -237,6 +237,8 @@ def initialize(self): def _do_i_compile(self): # new default: compile is enabled! + if self.device == torch.device('cpu'): + return False if 'nnUNet_compile' not in os.environ.keys(): return True else: