pbaylies / stylegan-encoder

StyleGAN Encoder - converts real images to latent space
Other
740 stars 180 forks source link

Getting error while run the 'encode_images.py' file #69

Open garry-qualhon opened 3 years ago

garry-qualhon commented 3 years ago

Hello there,

I am trying to the 'encode_images.py' file without any type of modification but it is not working as per the requirement. I had tried out lots of alternative solutions, which are not worked as well. I have cloned the code library from the following link : "git clone https://github.com/Puzer/stylegan-encoder.git" and I also tried your Git repo file, and that is also not working. I am using the google colab notebook to run the code when I am trying to run the code by using command "!python encode_images.py aligned_images/ generated_images/ latent_representations/", it's throwing me the following error:

Traceback (most recent call last):
  File "encode_images.py", line 80, in <module>
    main()
  File "encode_images.py", line 51, in main
    generator_network, discriminator_network, Gs_network = pickle.load(f)
  File "/content/stylegan-encoder/dnnlib/tflib/network.py", line 298, in __setstate__
    self._init_graph()
  File "/content/stylegan-encoder/dnnlib/tflib/network.py", line 141, in _init_graph
    with tf.name_scope(None):
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py", line 6691, in __init__
    raise ValueError("name for name_scope must be a string.")
ValueError: name for name_scope must be a string.

Please let me know what code changes I have to do with my files? I am struggling with this issue from last 3-4 days.