Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lileiNPU opened this issue Apr 26, 2018 · 3 comments
Open

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

lileiNPU opened this issue Apr 26, 2018 · 3 comments

Comments

@lileiNPU
Copy link

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
Copy link

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

@linkAmy
Copy link

linkAmy commented Aug 14, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants