# tf.keras.datasets.cifar100.load_data

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v2.14.0/keras/datasets/cifar100.py#L29-L100) |

Loads the CIFAR100 dataset.

    tf.keras.datasets.cifar100.load_data(
        label_mode='fine'
    )

This is a dataset of 50,000 32x32 color training images and
10,000 test images, labeled over 100 fine-grained classes that are
grouped into 20 coarse-grained classes. See more info at the
[CIFAR homepage](https://www.cs.toronto.edu/%7Ekriz/cifar.html).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `label_mode` | one of "fine", "coarse". If it is "fine" the category labels are the fine-grained labels, if it is "coarse" the output labels are the coarse-grained superclasses. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Tuple of NumPy arrays: `(x_train, y_train), (x_test, y_test)`. ||

<br />

**x_train** : uint8 NumPy array of image data with shapes
`(50000, 32, 32, 3)`, containing the training data. Pixel values range
from 0 to 255.

**y_train** : uint8 NumPy array of labels (integers in range 0-99)
with shape `(50000, 1)` for the training data.

**x_test** : uint8 NumPy array of image data with shapes
`(10000, 32, 32, 3)`, containing the test data. Pixel values range
from 0 to 255.

**y_test** : uint8 NumPy array of labels (integers in range 0-99)
with shape `(10000, 1)` for the test data.

#### Example:

    (x_train, y_train), (x_test, y_test) = keras.datasets.cifar100.load_data()
    assert x_train.shape == (50000, 32, 32, 3)
    assert x_test.shape == (10000, 32, 32, 3)
    assert y_train.shape == (50000, 1)
    assert y_test.shape == (10000, 1)