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' #49

Open
kimna4 opened this issue Oct 31, 2017 · 1 comment
Open

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

kimna4 opened this issue Oct 31, 2017 · 1 comment

Comments

@kimna4
Copy link

kimna4 commented Oct 31, 2017

Hello,
I'am a new to python and tensorflow.

I am trying to run the KittiBox.

However, below logs are printed when I run 'train.py''

===================================================================
Layer shape: (3, 3, 512, 512)
Layer name: conv5_3
Layer shape: (3, 3, 512, 512)
Layer name: fc6
Layer shape: [7, 7, 512, 4096]
Layer name: fc7
Layer shape: [1, 1, 4096, 4096]
Traceback (most recent call last):
File "/home/kimna/TensorflowWorkspace/KittiBox/train.py", line 82, in
tf.app.run()
File "/home/kimna/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/kimna/TensorflowWorkspace/KittiBox/train.py", line 78, in main
train.do_training(hypes)
File "incl/tensorvision/train.py", line 393, in do_training
modules['input'].start_enqueuing_threads(hypes, queue, 'train', sess)
File "/home/kimna/TensorflowWorkspace/KittiBox/hypes/../inputs/kitti_input.py", line 240, in start_enqueuing_threads
data = gen.next()
AttributeError: 'generator' object has no attribute 'next'

Process finished with exit code 1

I think the 'generator' is written in 'kitti_input.py' -> '_load_kitti_txt' function. However I can't debug the function with Pycharm debuging tool.

What is the my problem?

Thank you

@GeorgiAngelov
Copy link

GeorgiAngelov commented Nov 27, 2017

I have the same problem. Did you ever figure it out ? This is an error because the training file was written for python 2.7. In Python 3, the generator's next method is called using next(generator). There are a few other ones related to using xrange and using random.random().

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

2 participants