fashion_mnist数据集加载出错

使用 datasets.fashion_mnist.load_data() 下载并加载 fashion_mnist 数据集,运行时报错

1
EOFError: Compressed file ended before the end-of-stream marker was reached

根据网友的提示:由于网络问题,导致 fashion_mnist 数据集下载不全,删掉下载的文件重新下载就好。

macOS 解决方案

根据/Users/ashin/opt/anaconda3/envs/tensorflow/lib/python3.7/site-packages/tensorflow_core/python/keras/datasets/fashion_mnist.py

得知下载的数据集放在 datasets/fashion-mnist/ 下面 ,通过搜索找到其完整目录

1
2
3
4
$ cd ~/.keras/datasets/fashion-mnist
$ ls
t10k-images-idx3-ubyte.gz train-images-idx3-ubyte.gz
t10k-labels-idx1-ubyte.gz train-labels-idx1-ubyte.gz