load_data 函数tf_keras.datasets.cifar100.load_data(label_mode="fine", cache_dir=None)
加载 CIFAR100 数据集。
这是一个包含 50,000 张 32x32 彩色训练图像和 10,000 张测试图像的数据集,这些图像被标记为 100 个细粒度的类别,这些类别又被分为 20 个粗粒度的类别。更多信息请访问 CIFAR 主页。
参数
~/.keras/datasets。返回
(x_train, y_train), (x_test, y_test)。x_train: 形状为 (50000, 32, 32, 3) 的 uint8 NumPy 数组,包含图像数据的训练数据。像素值范围为 0 到 255。
y_train: 形状为 (50000, 1) 的 uint8 NumPy 数组,包含训练数据的标签(0-99 范围内的整数)。
x_test: 形状为 (10000, 32, 32, 3) 的 uint8 NumPy 数组,包含图像数据的测试数据。像素值范围为 0 到 255。
y_test: 形状为 (10000, 1) 的 uint8 NumPy 数组,包含测试数据的标签(0-99 范围内的整数)。
示例
(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)