0

As Tensorflow 1 becomes unsupported in Google Colab and StyleGAN2-ADA only works with Tensorflow 1. Can anyone help what I should do to solve this issue?

  • Is there a reason to not move to the [pytorch version](https://github.com/NVlabs/stylegan2-ada-pytorch)? – arowell Aug 31 '22 at 18:52

2 Answers2

0

This might work, if you want to run TF1 code under a recent version of TF2

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

(Instead of import tensorflow as tf, of course)

In TF 2.9.1 this is available but deprecated, and it will likely disappear in a not-too-distant future version

David Harris
  • 646
  • 3
  • 11
  • I've got this error after writing this solution "Import "tensorflow.compat.v1" could not be resolved", how can I solve it? – OmT Mar 31 '23 at 22:44
0

If you want to run Tf1 code on Google Colab you can uninstall the default installation of TensorFlow (Tf2) and install Tf1 manually, for example like this:

!pip uninstall tensorflow
!pip install tensorflow-gpu==1.15

This answer might also be helpful.

ClaudiaR
  • 3,108
  • 2
  • 13
  • 27