# coding:utf-8
import numpy as np
import matplotlib.pyplot as plt
import pickle
FILE_PATH = r"D:source echnology_sourceaisourcedscifar-10-pythonunzipdata_batch_1"
with open(FILE_PATH, 'rb') as fo:
data_dict = pickle.load(fo, encoding='bytes')
X = data_dict[b'data']
Y = data_dict[b'labels']
X = X.reshape(10000, 3, 32, 32).transpose(0, 2, 3, 1).astype("uint8")
Y = np.array(Y)
im = X[2000] # 显示第2000张图片
fig = plt.figure()
plt.axis('off')
plt.imshow(im)
plt.show()
plt.close()