PyTorch Vision MCQ
15 Questions
Time: ~25 mins
Intermediate
PyTorch Vision MCQ
Dataloaders, augmentations, and `models.resnet18(weights=...)`—the vision companion to torch.
Easy: 5 Q
Medium: 6 Q
Hard: 4 Q
torchvision
Package
datasets
ImageFolder
transforms
Augment
models
Pretrained
torchvision building blocks
torchvision supplies standard vision datasets, composable transforms (including v2 on newer versions), and reference CNN implementations with optional pretrained ImageNet weights. It pairs with torch.utils.data.DataLoader for batched training and evaluation.
Normalize correctly
Use dataset-specific mean/std (e.g. ImageNet) when fine-tuning pretrained backbones.
Key ideas
datasets.ImageFolder
Folder-per-class layout for custom classification.
transforms
Resize, crop, flip, tensorize, normalize.
models.*
resnet, convnext, etc. with weights enums.
DataLoader
Batching, shuffle, num_workers for throughput.
Train loop sketch
dataset + transform → DataLoader → model → loss → optimizer.step()
Pro tip: Pin memory and multiple workers speed GPU transfer on Linux; match image size to model expectation.