StyleGAN-Resolution-Convertor
StyleGAN-Resolution-Convertor copied to clipboard
dnnlib version issue
When I run the google colab book I get the following error in cell 5.
It looks like it might be an error with library version numbers. I'm guessing dnnlib is expecting an earlier version of tensorflow?
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-3b1f65e34697> in <module>()
4 import dnnlib
5 from dnnlib import EasyDict
----> 6 import dnnlib.tflib as tflib
7 from dnnlib.tflib import tfutil
8 import tensorflow as tf
---------------------------------2 frames---------------------------------
/content/stylegan/dnnlib/tflib/__init__.py in <module>()
6 # Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
7
----> 8 from . import autosummary
9 from . import network
10 from . import optimizer
/content/stylegan/dnnlib/tflib/autosummary.py in <module>()
29 from tensorboard.plugins.custom_scalar import layout_pb2
30
---> 31 from . import tfutil
32 from .tfutil import TfExpression
33 from .tfutil import TfExpressionEx
/content/stylegan/dnnlib/tflib/tfutil.py in <module>()
32
33
---> 34 def shape_to_list(shape: Iterable[tf.Dimension]) -> List[Union[int, None]]:
35 """Convert a Tensorflow shape to a list of ints."""
36 return [dim.value for dim in shape]
AttributeError: module 'tensorflow' has no attribute 'Dimension'
Pinning TensorFlow version 1.x solves this issue:
add %tensorflow_version 1.x in a new cell at the begining (at least: before the import tensorflow)