mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 05:22:06 -07:00
leras.nn : support for tf ver 1
This commit is contained in:
parent
241d1a9c35
commit
8ff34be5e4
1 changed files with 8 additions and 4 deletions
|
@ -76,14 +76,18 @@ 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
|
if tensorflow.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)
|
||||||
|
|
||||||
|
if tensorflow.VERSION[0] == '2':
|
||||||
tf.disable_v2_behavior()
|
tf.disable_v2_behavior()
|
||||||
nn.tf = tf
|
nn.tf = tf
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue