问题:
Exception: URL fetch failure on https://s3.amazonaws.com/img-datasets/mnist.npz: None -- [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
解决:
下载mnist.npz,将其保存到某文件夹下。
def load_data():
path='X://XX...//...//mnist.npz'
f = np.load(path)
x_train, y_train = f['x_train'], f['y_train']
x_test, y_test = f['x_test'], f['y_test']
f.close()
return (x_train, y_train), (x_test, y_test)
from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()

本文解决了一个在尝试从s3.amazonaws.com下载mnist.npz文件时遇到的WinError10060错误,指导读者如何手动下载并正确加载MNIST数据集到Keras项目中。

被折叠的 条评论
为什么被折叠?



