# Homework 2 Part 2 (Simplified) — Data

来源：https://www.kaggle.com/competitions/cifar-10-image-classification-exercise/data

采集时间：2026-10-19T10:39:51Z

# Data Description
This is the CIFAR-10 Dataset consists of a collection of 60,000 images of 32x32 pixels with three 8-bit RGB channels. Note that in some machine learning frameworks this data set can be downloaded directly into data structures useful for processing in the CNN.
![](assets/4159aac261e3b78873b9636f.jpg)

The data is REQUIRED to be read using the following code:
> `import torchvision`
> 
> `from torchvision.datasets import CIFAR10`
> 
> 
> `TRAIN_TRANSFORMS = torchvision.transforms.ToTensor()`
> 
> `TEST_TRANSFORMS = TRAIN_TRANSFORMS`
> 
> `BATCH_SIZE = 16`
> 
> `### DO NOT MODIFY ANY CODE STARTING HERE ###`
> 
> `cifar_train = CIFAR10('./data', download=True, train=True, transform=TRAIN_TRANSFORMS)`
> 
> `cifar_test = CIFAR10('./data', download=True, train=False, transform=TEST_TRANSFORMS)`
> 
> `temp_dataloader = torch.utils.data.DataLoader(cifar_data_test, batch_size=10000, shuffle=False)`
> 
> `temp_data = next(iter(temp_dataloader))[0]`
> 
> `train_dataloader = torch.utils.data.DataLoader(cifar_train, batch_size=BATCH_SIZE, shuffle=False)`
> 
> `test_dataloader = torch.utils.data.DataLoader(temp_data, batch_size=BATCH_SIZE, shuffle=False)`
> 
> `del cifar_train, cifar_test, temp_dataloader, temp_data`
> 
> `### END OF CODE NOT TO MODIFY ###`