【问题标题】:EOFError when downloading cifar10 dataset下载 cifar10 数据集时出现 EOFError
【发布时间】:2018-10-02 11:23:30
【问题描述】:

我在 keras 中下载 cifar10 数据集为:

(X_train, y_train), (X_test, y_test) = cifar10.load_data()

显示如下错误

Untaring file...
Traceback (most recent call last):

  File "<ipython-input-2-996c10ccd1de>", line 1, in <module>
    (X_train, y_train), (X_test, y_test) = cifar10.load_data()

  File "/home/meenu/anaconda3/lib/python3.6/site-packages/keras/datasets/cifar10.py", line 17, in load_data
    path = get_file(dirname, origin=origin, untar=True)

  File "/home/meenu/anaconda3/lib/python3.6/site-packages/keras/utils/data_utils.py", line 129, in get_file
    tfile.extractall(path=datadir)

  File "/home/meenu/anaconda3/lib/python3.6/tarfile.py", line 2007, in extractall
    numeric_owner=numeric_owner)

  File "/home/meenu/anaconda3/lib/python3.6/tarfile.py", line 2049, in extract
    numeric_owner=numeric_owner)

  File "/home/meenu/anaconda3/lib/python3.6/tarfile.py", line 2119, in _extract_member
    self.makefile(tarinfo, targetpath)

  File "/home/meenu/anaconda3/lib/python3.6/tarfile.py", line 2168, in makefile
    copyfileobj(source, target, tarinfo.size, ReadError, bufsize)

  File "/home/meenu/anaconda3/lib/python3.6/tarfile.py", line 248, in copyfileobj
    buf = src.read(bufsize)

  File "/home/meenu/anaconda3/lib/python3.6/gzip.py", line 276, in read
    return self._buffer.read(size)

  File "/home/meenu/anaconda3/lib/python3.6/_compression.py", line 68, in readinto
    data = self.read(len(byte_view))

  File "/home/meenu/anaconda3/lib/python3.6/gzip.py", line 482, in read
    raise EOFError("Compressed file ended before the "

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

【问题讨论】:

    标签: python-3.x


    【解决方案1】:

    我重新下载了 cifar-10 数据集,检查了它的 md5sum,然后修复了

    【讨论】:

      猜你喜欢
      • 2015-08-07
      • 1970-01-01
      • 1970-01-01
      • 2013-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多