From 4f462109858291f3499e8fab809d91e69a9d9532 Mon Sep 17 00:00:00 2001 From: vfdev Date: Tue, 3 Dec 2024 13:39:54 +0100 Subject: [PATCH] Updated GpuInfo metric, pynvml<12 (#3311) --- ignite/contrib/engines/common.py | 2 +- ignite/metrics/gpu_info.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ignite/contrib/engines/common.py b/ignite/contrib/engines/common.py index 09f769a18d0..bcfa54be55e 100644 --- a/ignite/contrib/engines/common.py +++ b/ignite/contrib/engines/common.py @@ -78,7 +78,7 @@ def setup_common_training_handlers( lr_scheduler: learning rate scheduler as native torch LRScheduler or ignite's parameter scheduler. with_gpu_stats: if True, :class:`~ignite.metrics.GpuInfo` is attached to the - trainer. This requires `pynvml` package to be installed. + trainer. This requires `pynvml<12` package to be installed. output_names: list of names associated with `update_function` output dictionary. with_pbars: if True, two progress bars on epochs and optionally on iterations are attached. Default, True. diff --git a/ignite/metrics/gpu_info.py b/ignite/metrics/gpu_info.py index 96ed4f07c57..d13bbd8a1da 100644 --- a/ignite/metrics/gpu_info.py +++ b/ignite/metrics/gpu_info.py @@ -10,7 +10,7 @@ class GpuInfo(Metric): """Provides GPU information: a) used memory percentage, b) gpu utilization percentage values as Metric - on each iterations. + on each iterations. This metric requires `pynvml `_ package of version `<12`. .. Note :: @@ -39,7 +39,7 @@ def __init__(self) -> None: except ImportError: raise ModuleNotFoundError( "This contrib module requires pynvml to be installed. " - "Please install it with command: \n pip install pynvml" + "Please install it with command: \n pip install 'pynvml<12'" ) # Let's check available devices if not torch.cuda.is_available():