From 8fe35671237ee86c3ec94db18df018dbc972aab3 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky <38561704+bertsky@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:02:41 +0200 Subject: [PATCH] set_memory_growth to all GPU devices alike --- qurator/eynollah/eynollah.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qurator/eynollah/eynollah.py b/qurator/eynollah/eynollah.py index 264bb62..9312c42 100644 --- a/qurator/eynollah/eynollah.py +++ b/qurator/eynollah/eynollah.py @@ -496,7 +496,8 @@ class Eynollah: #session = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(gpu_options=gpu_options)) physical_devices = tf.config.list_physical_devices('GPU') try: - tf.config.experimental.set_memory_growth(physical_devices[0], True) + for device in physical_devices: + tf.config.experimental.set_memory_growth(device, True) except: self.logger.warning("no GPU device available") if model_dir.endswith('.h5') and Path(model_dir[:-3]).exists():