CIFAR-10数据集处理

数据集下载官网:http://www.cs.toronto.edu/~kriz/cifar.html

def unpickle(file):
    import pickle
    with open(file, 'rb') as fo:
        dict = pickle.load(fo, encoding='bytes')
    return dict
train1=unpickle('data_batch_1')//读取数据集
print(np.shape(train1[b'labels']))//输出标签数组
print(np.shape(train1[b'data']))//输出图片数组
posted @ 2021-10-07 15:14  祥瑞哈哈哈  阅读(187)  评论(0)    收藏  举报