老师,这个报错一直找不到原因。。

来源:3-2 TensorFlow结合mnist进行线性模型训练(2)

阿娜苏苏

2018-08-11 20:31

D:\Programming\Anaconda3\python.exe D:/PycharmProjects/mnist_testdemo/mnist/regression.py

D:\Programming\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.

  from ._conv import register_converters as _register_converters

WARNING:tensorflow:From D:/PycharmProjects/mnist_testdemo/mnist/regression.py:5: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.

Instructions for updating:

Please use alternatives such as official/mnist/dataset.py from tensorflow/models.

WARNING:tensorflow:From D:\Programming\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py:260: maybe_download (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.

Instructions for updating:

Please write your own downloading logic.

WARNING:tensorflow:From D:\Programming\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py:262: extract_images (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.

Instructions for updating:

Please use tf.data to implement this functionality.

Extracting MNIST_data\train-images-idx3-ubyte.gz

Extracting MNIST_data\train-labels-idx1-ubyte.gz

WARNING:tensorflow:From D:\Programming\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py:267: extract_labels (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.

Instructions for updating:

Please use tf.data to implement this functionality.

Traceback (most recent call last):

  File "D:/PycharmProjects/mnist_testdemo/mnist/regression.py", line 5, in <module>

    data = input_data.read_data_sets('MNIST_data', one_hot=True)

  File "D:\Programming\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 250, in new_func

    return func(*args, **kwargs)

  File "D:\Programming\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py", line 267, in read_data_sets

    train_labels = extract_labels(f, one_hot=one_hot)

  File "D:\Programming\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 250, in new_func

    return func(*args, **kwargs)

  File "D:\Programming\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py", line 102, in extract_labels

    magic = _read32(bytestream)

  File "D:\Programming\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py", line 43, in _read32

    return numpy.frombuffer(bytestream.read(4), dtype=dt)[0]

IndexError: index 0 is out of bounds for axis 0 with size 0


Process finished with exit code 1


写回答 关注

2回答

  • Shine36
    2019-01-23 15:04:14

    版本问题不对的话难道要重新下载anaconda

  • qq_晓K_0
    2018-10-23 14:56:50

    read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.

    版本不对

TensorFlow与Flask结合打造手写体数字识别

TensorFlow和flask结合识别自己的手写体数字

20435 学习 · 102 问题

查看课程

相似问题