enter image description here!python encode_images.py --optimizer=lbfgs --face_mask=True --iterations=6 --use_lpips_loss=0 --use_discriminator_loss=0 --output_video=True aligned_images/ generated_images/ latent_representations/
print("\n************ Latent code optimization finished! ***************")
2021-08-24 13:33:11.033451: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last): File "encode_images.py", line 12, in import dnnlib.tflib as tflib File "C:\Users\bkvij\Office Rapid Innovation\StyleGAN Face Morphing - Arxiv Insights\stylegan-encoder\dnnlib\tflib_init_.py", line 8, in
from . import autosummary File "C:\Users\bkvij\Office Rapid Innovation\StyleGAN Face Morphing - Arxiv Insights\stylegan-encoder\dnnlib\tflib\autosummary.py", line 31, in
from . import tfutil File "C:\Users\bkvij\Office Rapid Innovation\StyleGAN Face Morphing - Arxiv Insights\stylegan-encoder\dnnlib\tflib\tfutil.py", line 34, in
def shape_to_list(shape: Iterable[tf.Dimension]) -> List[Union[int, None]]: AttributeError: module 'tensorflow' has no attribute 'Dimension'
To expand on Faezeh's answer, you'll have to make the following edits to tfutils.py
From
tf.Dimension
(line 34)tf.variable_scope
(line 74)tf.Session
(line 128)To
tf.compat.v1.Dimension
tf.compat.v1.variable_scope
tf.compat.v1.Session
alternatively, you could just download tensorflow 1.x and save yourself the hassle