From 0729b4eef015482a25ffb9232d6473b97f4a69a0 Mon Sep 17 00:00:00 2001 From: chaklim Date: Mon, 11 Nov 2019 00:05:40 +0800 Subject: [PATCH] Suppress future warnings on tensorflow --- clair/model.py | 10 +++++++--- clair/selu.py | 24 +++++++++++++----------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/clair/model.py b/clair/model.py index b14efb9..6ad1b15 100644 --- a/clair/model.py +++ b/clair/model.py @@ -1,12 +1,16 @@ -import tensorflow as tf +import warnings +with warnings.catch_warnings(): + warnings.filterwarnings("ignore",category=FutureWarning) + import tensorflow as tf + from tensorflow.python.client import device_lib + from tensorflow.python.ops import array_ops + import numpy as np import re import multiprocessing from sys import exit from os.path import abspath from argparse import ArgumentParser -from tensorflow.python.client import device_lib -from tensorflow.python.ops import array_ops from collections import defaultdict from clair.task.main import GT21, GENOTYPE, VARIANT_LENGTH_1, VARIANT_LENGTH_2 diff --git a/clair/selu.py b/clair/selu.py index b715361..ca2c46c 100644 --- a/clair/selu.py +++ b/clair/selu.py @@ -1,18 +1,20 @@ ''' Tensorflow Implementation of the Scaled ELU function and Dropout ''' - - +import warnings +with warnings.catch_warnings(): + warnings.filterwarnings("ignore",category=FutureWarning) + import tensorflow as tf + from tensorflow.contrib import layers + from tensorflow.python.framework import ops + from tensorflow.python.framework import tensor_shape + from tensorflow.python.framework import tensor_util + from tensorflow.python.ops import math_ops + from tensorflow.python.ops import random_ops + from tensorflow.python.ops import array_ops + from tensorflow.contrib.layers.python.layers import utils import numbers -from tensorflow.contrib import layers -from tensorflow.python.framework import ops -from tensorflow.python.framework import tensor_shape -from tensorflow.python.framework import tensor_util -from tensorflow.python.ops import math_ops -from tensorflow.python.ops import random_ops -from tensorflow.python.ops import array_ops -from tensorflow.contrib.layers.python.layers import utils -import tensorflow as tf + # (1) scale inputs to zero mean and unit variance