0
0
PyTorchml~20 mins

Built-in datasets (torchvision.datasets) in PyTorch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Torchvision Dataset Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of loading CIFAR10 dataset
What is the output of the following code snippet when loading the CIFAR10 training dataset?
PyTorch
import torchvision.datasets as datasets
cifar10_train = datasets.CIFAR10(root='./data', train=True, download=False)
print(len(cifar10_train))
A6000
B60000
C5000
D50000
Attempts:
2 left
💡 Hint
Recall the number of training images in CIFAR10 dataset.
Model Choice
intermediate
2:00remaining
Choosing dataset for handwritten digit recognition
Which torchvision built-in dataset is best suited for training a model to recognize handwritten digits?
Adatasets.CIFAR10
Bdatasets.MNIST
Cdatasets.FashionMNIST
Ddatasets.ImageNet
Attempts:
2 left
💡 Hint
Think about which dataset contains handwritten digits.
Hyperparameter
advanced
2:00remaining
Effect of 'transform' parameter in torchvision datasets
What is the effect of passing a torchvision.transforms.Compose object to the 'transform' parameter when loading a dataset like CIFAR10?
AIt applies the specified transformations to each image when accessed from the dataset.
BIt changes the dataset size by filtering images based on the transform.
CIt downloads additional images matching the transform criteria.
DIt converts the dataset labels to one-hot encoded vectors.
Attempts:
2 left
💡 Hint
Consider when and how transforms are applied in PyTorch datasets.
Metrics
advanced
2:00remaining
Number of classes in FashionMNIST dataset
How many distinct classes does the FashionMNIST dataset contain?
A50
B100
C10
D5
Attempts:
2 left
💡 Hint
FashionMNIST has the same number of classes as MNIST.
🔧 Debug
expert
2:00remaining
Error raised when loading ImageNet without download
What error will be raised by the following code if the ImageNet dataset is not downloaded in the specified root folder? import torchvision.datasets as datasets imagenet = datasets.ImageNet(root='./data', split='train', download=False)
ARuntimeError
BFileNotFoundError
CValueError
DTypeError
Attempts:
2 left
💡 Hint
Think about what happens if the dataset files are missing and download is False.