TensorFlow MNIST机器学习入门 input

xiaoxiao2021-02-27  450

开始学习机器学习。

TensorFlow 教程第一个例子下载数据报错了。国外找到的解决方法:

you can modify the function:

def _read32(bytestream): dt = numpy.dtype(numpy.uint32).newbyteorder('>') return numpy.frombuffer(bytestream.read(4), dtype=dt)

new version:

def _read32(bytestream): dt = numpy.dtype(numpy.uint32).newbyteorder('>') return numpy.frombuffer(bytestream.read(4), dtype=dt)[0]

add [0] in the end.

This appears to be an issue with the latest version of Numpy. A recent change made it an error to treat a single-element array as a scalar for the purposes of indexing.

原文地址:

http://stackoverflow.com/questions/42128830/typeerror-only-integer-scalar-arrays-can-be-converted-to-a-scalar-index

转载请注明原文地址: https://www.6miu.com/read-2602.html

最新回复(0)