igul222 / improved_wgan_training

Code for reproducing experiments in "Improved Training of Wasserstein GANs"
MIT License
2.36k stars 670 forks source link

AttributeError: 'generator' object has no attribute 'next' #70

Open lileiNPU opened 6 years ago

lileiNPU commented 6 years ago

File "C:/Users/Daxika/Desktop/improved_wgan_training-master/improved_wgan_training-master/gan_toy.py", line 239, in _data = gen.next() AttributeError: 'generator' object has no attribute 'next'

I need help

wchen342 commented 6 years ago

Use next(gen) instead of gen.next().

linkAmy commented 5 years ago

This problem seems to be caused by the difference between python 2 and python 3, so I use gen.__next__() instead. Then it works fine.

Mike-Pits commented 7 months ago

Guess you could as well solve that by applying 'gen[0]' instead of deprecated 'gen.next()'. Works for python3. Not sure abt version 2.