第2章拆分数据集的时候遇到报错
来源:2-4 实战分类模型之模型构建
闪闪一年
2020-03-05
fashion_mnist = keras.datasets.fashion_mnist
(x_train_all, y_train_all), (x_test, y_test) = fashion_mnist.load_data()
x_valid, x_train = x_train_all[:5000], x_train_all[5000:]
y_valid, y_train = y_train_all[:5000], y_train_all[5000:]
print(x_valid.shape, y_valid.shape)
print(x_train.shape, y_train.shape)
print(x_test.shape, y_test.shape)
报错信息如下:
环境信息如下:
2.0.0
sys.version_info(major=3, minor=7, micro=6, releaselevel='final', serial=0)
matplotlib 3.1.3
numpy 1.18.1
pandas 1.0.1
sklearn 0.22.1
tensorflow 2.0.0
tensorflow_core.keras 2.2.4-tf
写回答
1回答
-
正十七
2020-03-11
应该是下载出错,你可以去~/.keras/dataset下找到下载文件,删除了,然后再运行这个代码重新下载。
012020-03-11
相似问题