【问题标题】:tflearn cannot read mnist datatflearn 无法读取 mnist 数据
【发布时间】:2017-07-07 22:34:08
【问题描述】:

我正在尝试使用 tensorflow 进行卷积神经网络。我为此使用 tflearn。我已经从this site下载了数据

Traceback (most recent call last):
File "C:/Users/Sukumar/Python/ML/cnn_tflearn.py", line 7, in <module>
X, Y, test_x, test_y = mnist.load_data(one_hot=True)
File "C:\Users\Sukumar\Miniconda3\lib\site-packages\tflearn\datasets\mnist.py", line 15, in load_data
mnist = read_data_sets("mnist/", one_hot=one_hot)
File "C:\Users\Sukumar\Miniconda3\lib\site-packages\tflearn\datasets\mnist.py", line 161, in read_data_sets
train_images = extract_images(local_file)
File "C:\Users\Sukumar\Miniconda3\lib\site-packages\tflearn\datasets\mnist.py", line 50, in extract_images
buf = bytestream.read(rows * cols * num_images)
File "C:\Users\Sukumar\Miniconda3\lib\gzip.py", line 274, in read
return self._buffer.read(size)
TypeError: only integer scalar arrays can be converted to a scalar index

【问题讨论】:

  • 脚本通常会自行下载数据。你能试试吗?
  • 我也这样做了,但我仍然遇到同样的错误......一些stackoverflow qn说文件在下载时可能已损坏并导致此错误
  • 您可以尝试针对 tflearn github 提交错误,该错误不是由 tensorflow 团队管理的。在我们的贡献directory 中有一个load_mnist,所以你可以试试。

标签: tensorflow tflearn


【解决方案1】:

MNIST 文件将适用于使用 NVIDIA cuDNN 且支持 GPU 的 TensorFlow 版本,这里有一篇关于安装它们的帖子How to verify CuDNN installation?

【讨论】:

  • 我确实使用了 tensorflow 提供的 mnist 文件。但是 tflearn 中的那些不起作用,我尝试在 tensorflow mnist 文件上运行相同的代码,但我得到了同样的错误
  • 您的 tensorflow 版本是否支持 GPU?
  • 不...不是。我没有显卡
猜你喜欢
  • 2017-07-12
  • 1970-01-01
  • 1970-01-01
  • 2017-04-25
  • 1970-01-01
  • 2017-08-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多