《Hands on Sklearn and TF》(1)

第三章中的MNIST数据集下载问题:


from sklearn.datasets import fetch_mldata

mnist = fetch_mldata('MNIST original')

这里程序会默认从sklearn 中下载MNIST original数据,这样程序运行可能会比较慢。这里是fetch_mldata()的说明:
http://scikit-learn.org/stable/datasets/mldata.html
第一行写到:

mldata.org is a public repository for machine learning data, supported by the PASCAL network .
The sklearn.datasets package is able to directly download data sets from the repository using the functionsklearn.datasets.fetch_mldata.

因此,可以事先去mldata.org(by the way,这个数据库有丰富的数据集可以拿来用) 把MNIST数据集下好,放在当前程序的‘\MNIST_data\mldata’文件夹下。
相应的,源程序改为:


from sklearn.datasets import fetch_mldata

mnist = fetch_mldata('MNIST original',data_home='MNIST_data/') 

本地导入MNIST数据集的结果

这样就可以了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 花儿依旧开,少年几度笑。 开放无渐之,笑与思念长。 花开常有时,惊蛰日,湿冷模式。 最爱那一抹红,色香,有味。 路...
    阿琴的精彩阅读 151评论 0 0
  • 晨会,即营销会议,营销会议最重要的不是数据,不是事情,而是士气。一个店铺店长能力如何?看她晨会结束以后,员工的状态...
    天蓝槑Ln阅读 465评论 0 0
  • 路径,用直接选择工具选中某锚点,delete键,得到不闭合的路径
    syeturing阅读 121评论 0 0