mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 13:02:15 -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,15 +76,26 @@ class nn():
|
||||||
if first_run:
|
if first_run:
|
||||||
io.log_info("Caching GPU kernels...")
|
io.log_info("Caching GPU kernels...")
|
||||||
|
|
||||||
#import tensorflow as tf
|
import tensorflow
|
||||||
import tensorflow.compat.v1 as tf
|
|
||||||
|
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
|
import logging
|
||||||
# Disable tensorflow warnings
|
# Disable tensorflow warnings
|
||||||
tf_logger = logging.getLogger('tensorflow')
|
tf_logger = logging.getLogger('tensorflow')
|
||||||
tf_logger.setLevel(logging.ERROR)
|
tf_logger.setLevel(logging.ERROR)
|
||||||
|
|
||||||
tf.disable_v2_behavior()
|
if tf_version[0] == '2':
|
||||||
|
tf.disable_v2_behavior()
|
||||||
nn.tf = tf
|
nn.tf = tf
|
||||||
|
|
||||||
# Initialize framework
|
# Initialize framework
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue