From f7fd55c80bfa06196f82c37b65f102038571218b Mon Sep 17 00:00:00 2001 From: Ou Ku Date: Tue, 30 Jul 2024 14:40:08 +0200 Subject: [PATCH] no overwriting tensorflow environment variable --- motrainer/model.py | 3 ++- motrainer/util.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/motrainer/model.py b/motrainer/model.py index e5ae3c9..2742d0a 100644 --- a/motrainer/model.py +++ b/motrainer/model.py @@ -9,7 +9,8 @@ import tensorflow as tf # Force tensorflow debug logging off, keep only error logging -os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' +if "TF_CPP_MIN_LOG_LEVEL" not in os.environ: + os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" def keras_dnn(dimensions, input_shape, output_shape): diff --git a/motrainer/util.py b/motrainer/util.py index d889e82..decf340 100644 --- a/motrainer/util.py +++ b/motrainer/util.py @@ -8,7 +8,8 @@ from scipy.stats import pearsonr, spearmanr # Force tensorflow debug logging off, keep only error logging -os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' +if "TF_CPP_MIN_LOG_LEVEL" not in os.environ: + os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" def performance(data_input, data_label, model, method, scaler_output=None):