Challenge - 5 Problems
Torchvision Dataset Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2: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))
Attempts:
2 left
💡 Hint
Recall the number of training images in CIFAR10 dataset.
✗ Incorrect
The CIFAR10 training dataset contains exactly 50,000 images. The code prints the length of the dataset, which is 50000.
❓ Model Choice
intermediate2:00remaining
Choosing dataset for handwritten digit recognition
Which torchvision built-in dataset is best suited for training a model to recognize handwritten digits?
Attempts:
2 left
💡 Hint
Think about which dataset contains handwritten digits.
✗ Incorrect
MNIST contains grayscale images of handwritten digits 0-9, making it ideal for digit recognition tasks.
❓ Hyperparameter
advanced2: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?
Attempts:
2 left
💡 Hint
Consider when and how transforms are applied in PyTorch datasets.
✗ Incorrect
The 'transform' parameter applies the given transformations to each image on-the-fly when the image is accessed, without changing dataset size or labels.
❓ Metrics
advanced2:00remaining
Number of classes in FashionMNIST dataset
How many distinct classes does the FashionMNIST dataset contain?
Attempts:
2 left
💡 Hint
FashionMNIST has the same number of classes as MNIST.
✗ Incorrect
FashionMNIST contains 10 classes representing different clothing items.
🔧 Debug
expert2: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)
Attempts:
2 left
💡 Hint
Think about what happens if the dataset files are missing and download is False.
✗ Incorrect
If the ImageNet dataset files are not found in the root directory and download is False, a RuntimeError is raised.