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: 'Iterator' object has no attribute 'next' #5

Open
nupur0294 opened this issue Mar 16, 2020 · 0 comments
Open

AttributeError: 'Iterator' object has no attribute 'next' #5

nupur0294 opened this issue Mar 16, 2020 · 0 comments

Comments

@nupur0294
Copy link

frame_batches = tf.compat.v1.data.make_one_shot_iterator(frame_tensors) # outside of TF Eager, we would use make_one_shot_iterator
mask_batches = tf.compat.v1.data.make_one_shot_iterator(masks_tensors)

n_images_to_show = 5

for i in range(n_images_to_show):

# Get the next image from iterator
frame = frame_batches.next().numpy().astype(np.uint8)
mask = mask_batches.next().numpy().astype(np.uint8)

for the above i get error:

AttributeError Traceback (most recent call last)
~/.local/lib/python3.6/site-packages/tensorflow/python/keras/api/_v1/keras/models/init.py in
4
5 # Get the next image from iterator
----> 6 frame = frame_batches.next().numpy().astype(np.uint8)
7 mask = mask_batches.next().numpy().astype(np.uint8)
8

AttributeError: 'Iterator' object has no attribute 'next'

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

1 participant