03. PyTorch Computer Vision . Prepeare a datamodel problem #811
Replies: 2 comments
-
In PyTorch, the training dataloader typically yields batches of input features and their corresponding labels. In your case:
The sizes aren't the same because each element in When you iterate over |
Beta Was this translation helpful? Give feedback.
-
To put it simply, train_features_batch, train_labels_batch = next(iter(train_dataloader))
While,
The code snippet is just to assign batch_size (32) to load 32 images and respective 32 labels at a time in training device for model training. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey i just reviewed one part of code.
Check out what's inside the training dataloader train_features_batch, train_labels_batch = next(iter(train_dataloader)) train_features_batch.shape, train_labels_batch.shape
I cant understand why it gives this when launching
(torch.Size([32, 1, 28, 28]), torch.Size([32]))
Why theyr sizes and values are not the same? Dont author assigned them together here? How it works?
train_features_batch, train_labels_batch = next(iter(train_dataloader))
Beta Was this translation helpful? Give feedback.
All reactions