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

Fix access to the interator and display a better plot #1527

Merged
merged 3 commits into from
Dec 30, 2022

Conversation

adam-narozniak
Copy link
Member

@adam-narozniak adam-narozniak commented Dec 30, 2022

It fixes access to the trainloader required to display a batch of CIFAR10 images.
Before:

images, labels = iter(trainloaders[0]).next()

Gives: AttributeError: '_SingleProcessDataLoaderIter' object has no attribute 'next'

Now:

images, labels = next(iter(trainloaders[0]))

Additionally, it creates a more appealing plot of images (bigger plot, space between images, labels directly above the images).
Before (with the iterator access fix):
Screen Shot 2022-12-30 at 11 14 42
After:
Screen Shot 2022-12-30 at 11 13 51

Copy link
Member

@danieljanes danieljanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@danieljanes danieljanes enabled auto-merge (squash) December 30, 2022 12:24
@danieljanes danieljanes merged commit 1ba30bc into main Dec 30, 2022
@danieljanes danieljanes deleted the fix-dataset-access-intro-tutorial branch December 30, 2022 12:31
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

Successfully merging this pull request may close these issues.

2 participants