数据读取
需要提前配置有keras的环境
下载CIFAR-10 and CIFAR-100 datasets的python版本并解压到C:\Users\mage\.keras\datasets
REF:读取cifar-10数据集_zhanzi1538的博客-CSDN博客_cifar10数据集读取
from __future__ import print_function
from six.moves import cPickle as pickle
import numpy as np
import os
import platform
# 读取文件
def load_pickle(f):
version = platform.python_version_tuple() # 取python版本号
if version[0] == '2':
return pickle.load(f) # pickle.load, 反序列化为python的数据类型
elif ve