Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow 2.x compatibility #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dataset_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import six.moves.queue as Queue # pylint: disable=import-error
import traceback
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import PIL.Image
import dnnlib.tflib as tflib

Expand Down
3 changes: 2 additions & 1 deletion dnnlib/tflib/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import platform
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

from collections import OrderedDict
from typing import List, Union
Expand Down
8 changes: 5 additions & 3 deletions dnnlib/tflib/tfutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

import os
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()


# Silence deprecation warnings from TensorFlow 1.13 onwards
import logging
logging.getLogger('tensorflow').setLevel(logging.ERROR)
import tensorflow.contrib # requires TensorFlow 1.x!
tf.contrib = tensorflow.contrib
#import tensorflow.contrib # requires TensorFlow 1.x!
#tf.contrib = tensorflow.contrib

from typing import Any, Iterable, List, Union

Expand Down