gpt4 book ai didi

python - zlib.错误 : Error -3 while decompressing: invalid distance code

转载 作者:行者123 更新时间:2023-12-01 04:03:40 25 4
gpt4 key购买 nike

我试图使用 mnist 数据集使用 Tensorflow 创建模型。我已经正确安装了 Tensorflow,然后当我尝试使用命令创建模型时。

python convolutional.py

我在控制台上收到错误消息:

Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.
Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.
Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.
Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.
Extracting data/train-images-idx3-ubyte.gz
Traceback (most recent call last):
File "convolutional.py", line 316, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/_app.py", line 30, in run
sys.exit(main(sys.argv))
File "convolutional.py", line 128, in main
train_data = extract_data(train_data_filename, 60000)
File "convolutional.py", line 75, in extract_data
buf = bytestream.read(IMAGE_SIZE * IMAGE_SIZE * num_images)
File "/usr/lib/python2.7/gzip.py", line 261, in read
self._read(readsize)
File "/usr/lib/python2.7/gzip.py", line 312, in _read
uncompress = self.decompress.decompress(buf)
zlib.error: Error -3 while decompressing: invalid block type

我正在使用安装在 14.04 Ubuntu 操作系统中的 Python2.7。

最佳答案

问题的根源似乎是无效的数据文件:“data/train-images-idx3-ubyte.gz”。有什么方法可以获取文件的新副本吗?请使用以下 shell 命令验证文件的新副本:

gunzip -t  data/train-images-idx3-ubyte.gz

一旦上述测试返回 gz 文件有效的答案,就执行您的脚本:

python convolutional.py

关于python - zlib.错误 : Error -3 while decompressing: invalid distance code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36055090/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com