stylegan-encoder icon indicating copy to clipboard operation
stylegan-encoder copied to clipboard

Getting error while run the 'encode_images.py' file

Open garry-qualhon opened this issue 2 years ago • 0 comments

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.

garry-qualhon avatar Nov 09 '21 12:11 garry-qualhon