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

updated tfutil for tensorflow 2.x #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PsVenom
Copy link

@PsVenom PsVenom commented Aug 22, 2022

some commands were depreciated in 2.x, so I fixed it by using tf.compat.v1

some commands were depreciated in 2.x, so I fixed it
@@ -125,7 +125,7 @@ def assert_tf_initialized():
raise RuntimeError("No default TensorFlow session found. Please call dnnlib.tflib.init_tf().")


def create_session(config_dict: dict = None, force_as_default: bool = False) -> tf.Session:
def create_session(config_dict: dict = None, force_as_default: bool = False) -> tf.compat.v1.Session:
"""Create tf.Session based on config dict."""
# Setup TensorFlow config proto.
cfg = _sanitize_tf_config(config_dict)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line 132, I had to also update

config_proto =  tf.compat.v1.ConfigProto()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, do you have full working code for this repo but using tf 2.x?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atreeleaf I'll review the codebase again and replace any other depreciated functions. Thanks for bringing this to my attention

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atreeleaf @PsVenom
Hi all! Is there a running Tensorflow2 compatible StyleGAN2 Colab notebook? Thank you!

@zjw710
Copy link

zjw710 commented Dec 28, 2022 via email

1 similar comment
@zjw710
Copy link

zjw710 commented Feb 2, 2024 via email

@Merzmensch
Copy link

Hi all! Is there a running Tensorflow2 compatible StyleGAN2 Colab notebook? Thank you!

@zjw710
Copy link

zjw710 commented Aug 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants