Merge branch 'master' into new_gan

This commit is contained in:
iperov 2021-01-01 18:04:10 +04:00
commit 140f16f772

View File

@ -76,15 +76,26 @@ class nn():
if first_run:
io.log_info("Caching GPU kernels...")
#import tensorflow as tf
import tensorflow.compat.v1 as tf
import tensorflow
tf_version = getattr(tensorflow,'VERSION', None)
if tf_version is None:
tf_version = tensorflow.version.GIT_VERSION
if tf_version[0] == 'v':
tf_version = tf_version[1:]
if tf_version[0] == '2':
tf = tensorflow.compat.v1
else:
tf = tensorflow
import logging
# Disable tensorflow warnings
tf_logger = logging.getLogger('tensorflow')
tf_logger.setLevel(logging.ERROR)
tf.disable_v2_behavior()
if tf_version[0] == '2':
tf.disable_v2_behavior()
nn.tf = tf
# Initialize framework