From 92a243b3917b5a3fcf040a57bf705416d16ac46a Mon Sep 17 00:00:00 2001 From: Nathan Painchaud Date: Tue, 30 Aug 2022 11:09:26 +0200 Subject: [PATCH] Migrate from `gpus` flag (to be deprecated in PL 1.7) to `accelerator` and `devices` --- vital/config/trainer/default.yaml | 3 ++- vital/utils/sys.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vital/config/trainer/default.yaml b/vital/config/trainer/default.yaml index 6a3226014..e7f29fe3a 100644 --- a/vital/config/trainer/default.yaml +++ b/vital/config/trainer/default.yaml @@ -1,3 +1,4 @@ _target_: pytorch_lightning.Trainer -gpus: ${sys.gpus:} +accelerator: "auto" +devices: null enable_progress_bar: True diff --git a/vital/utils/sys.py b/vital/utils/sys.py index e22a49261..1955b98f9 100644 --- a/vital/utils/sys.py +++ b/vital/utils/sys.py @@ -9,7 +9,6 @@ def register_omegaconf_resolvers() -> None: """Registers various OmegaConf resolvers useful to query system info.""" - OmegaConf.register_new_resolver("sys.gpus", lambda x=None: int(torch.cuda.is_available())) OmegaConf.register_new_resolver("sys.num_workers", lambda x=None: os.cpu_count() - 1) OmegaConf.register_new_resolver("sys.getcwd", lambda x=None: os.getcwd()) OmegaConf.register_new_resolver("sys.eps.np", lambda dtype: np.finfo(np.dtype(dtype)).eps)