mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2024-03-22 13:10:55 +08:00
Merge branch 'master' into new_gan
This commit is contained in:
commit
140f16f772
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user