以mnist.pkl为例
方法一:
然而我的还是会出现EOFError,无解,郁闷
dataset=’mnist.pkl’
datasets = load_data(dataset)
train_set_x, train_set_y = datasets[0]
valid_set_x, valid_set_y = datasets[1]
test_set_x, test_set_y = datasets[2]
正解,哈哈~
如果要打开的是压缩文件,那就小小修改一下,如下,
dataset=’mnist.pkl.gz’
datasets = load_data(dataset)
train_set_x, train_set_y = datasets[0]
valid_set_x, valid_set_y = datasets[1]
test_set_x, test_set_y = datasets[2]
方法四:
输出:
方法五:
讲道理,最后一个才是最好用的,,
然而我居然绕了十八弯才知道,,真是一只蠢蠢的菜鸟,让我哀伤一会~