汪呀呀呀呀呀呀呀 2020-10-29 18:20 采纳率: 0%
浏览 4558

手写体数字识别IndexError: index 0 is out of bounds for axis 0 with size 0

就是普通的基于全连接层网络结构的神经网络的例子,同样的源代码同学就能运行,但是我不行,不知道哪里出问题了

runfile('/Users/wangyue/Desktop/手写数字识别/Handwritten-Numeral-Recognition/minist_eval.py', wdir='/Users/wangyue/Desktop/手写数字识别/Handwritten-Numeral-Recognition')
Extracting ../../../datasets/MNIST_data/train-images-idx3-ubyte.gz

Traceback (most recent call last):
File "", line 1, in
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/wangyue/Desktop/手写数字识别/Handwritten-Numeral-Recognition/minist_eval.py", line 46, in
main()
File "/Users/wangyue/Desktop/手写数字识别/Handwritten-Numeral-Recognition/minist_eval.py", line 41, in main
mnist = input_data.read_data_sets("../../../datasets/MNIST_data", one_hot=True)
File "/Users/wangyue/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 243, in read_data_sets
train_images = extract_images(f)
File "/Users/wangyue/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 55, in extract_images
magic = _read32(bytestream)
File "/Users/wangyue/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 37, in _read32
return numpy.frombuffer(bytestream.read(4), dtype=dt)[0]
IndexError: index 0 is out of bounds for axis 0 with size 0
想问一下这是怎么回事?我换过很多种办法,都没有解决掉

  • 写回答

3条回答 默认 最新

  • 汪呀呀呀呀呀呀呀 2020-11-11 11:01
    关注

    是mnist数据集导入出错了
    下载mnist__data数据集4个文件就好

    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题