mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 04:52:13 -07:00
Merge branch 'master' into new_gan
This commit is contained in:
commit
140f16f772
1 changed files with 14 additions and 3 deletions
|
@ -76,14 +76,25 @@ 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)
|
||||
|
||||
if tf_version[0] == '2':
|
||||
tf.disable_v2_behavior()
|
||||
nn.tf = tf
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue