一、今天在学习capsuleNet时,在github上找到了keras在mnist数据集上训练的源码,但是运行时被卡在了一个地方,就是keras中自带的minist.load_data()函数,后来通过CTRL+右键寻其源码发现,原来加载数据的那个网址被墙了,代码如下:
def load_data(path='mnist.npz'): path = get_file(path, origin='https://s3.amazonaws.com/img-datasets/mnist.npz', file_hash='8a61469f7ea1b51cbae51d4f78837e45') 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)
于是就很好解决了,在网上找一个mnist.npz数据,本地加载就ok了!
二、有时
由于服务器防火墙的原因jupyter notebook不能远程连接服务器,因此不好调试大数据量的代码,所以可以利用最原始的python命令来一行一行的查看输出结果。
最后
以上就是风趣冰棍最近收集整理的关于【python人工智能开发过程中的小技巧——keras在线加载mnist数据集】的全部内容,更多相关【python人工智能开发过程中内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复