Puzer / stylegan-encoder

StyleGAN Encoder - converts real images to latent space
Other
1.07k stars 166 forks source link

Update generator_model.py #19

Open Uha661 opened 5 years ago

progmars commented 4 years ago

The fix leads to error:

 File "encode_images.py", line 84, in <module>
    main()
  File "encode_images.py", line 57, in main
    generator = Generator(Gs_network, args.batch_size, randomize_noise=args.randomize_noise)
  File "D:\GAN\stylegan\encoder\generator_model.py", line 35, in __init__
    self.set_dlatents(self.initial_dlatents)
  File "D:\GAN\stylegan\encoder\generator_model.py", line 46, in set_dlatents
    self.sess.run(tf.assign(self.dlatent_variable, dlatents))
  File "D:\GAN\Anaconda\lib\site-packages\tensorflow\python\ops\state_ops.py", line 224, in assign
    if ref.dtype._is_ref_dtype:
AttributeError: 'generator' object has no attribute 'dtype'

And it seems to be unnecessary at all. I found that StopIteration error occurs only if you use Nvlabs dmlib instead of this repository dmlib because this one has modifications to pass custom arguments to the run method.