From 03faea8404e1559482bcdcfc7b361d4a26bedcb8 Mon Sep 17 00:00:00 2001 From: chaklim Date: Mon, 11 Nov 2019 00:26:10 +0800 Subject: [PATCH] Suppress deprecation warnings on tensorflow --- clair/model.py | 5 ++++- clair/selu.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/clair/model.py b/clair/model.py index 6ad1b15..4f777e8 100644 --- a/clair/model.py +++ b/clair/model.py @@ -1,6 +1,9 @@ import warnings with warnings.catch_warnings(): - warnings.filterwarnings("ignore",category=FutureWarning) + warnings.filterwarnings('ignore', category=DeprecationWarning) + warnings.filterwarnings("ignore", category=FutureWarning) + from tensorflow.python.util import deprecation + deprecation._PRINT_DEPRECATION_WARNINGS = False import tensorflow as tf from tensorflow.python.client import device_lib from tensorflow.python.ops import array_ops diff --git a/clair/selu.py b/clair/selu.py index ca2c46c..3e6d696 100644 --- a/clair/selu.py +++ b/clair/selu.py @@ -3,7 +3,10 @@ ''' import warnings with warnings.catch_warnings(): - warnings.filterwarnings("ignore",category=FutureWarning) + warnings.filterwarnings('ignore', category=DeprecationWarning) + warnings.filterwarnings("ignore", category=FutureWarning) + from tensorflow.python.util import deprecation + deprecation._PRINT_DEPRECATION_WARNINGS = False import tensorflow as tf from tensorflow.contrib import layers from tensorflow.python.framework import ops