关于TensorFlow的MNIST数据集下载脚本input_data.py的坑

来源:互联网 发布:linux 输入法 编辑:程序博客网 时间:2024/06/05 09:34

今天用github上的代码入门tensorflow但是发现似乎要下载数据集,但是这个我弄了一会才明白是怎么下的,所以把经验写在下面:(ubuntu14.04环境)

用github上的input_data.py


from __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionimport gzipimport osimport tempfileimport numpyfrom six.moves import urllibfrom six.moves import xrange  # pylint: disable=redefined-builtinimport tensorflow as tffrom tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets

把这个文件和github上的nearst_neighbor.py放在一个py工程目录下的两个py文件,然后就可以搞了。

(要注意资源目录的问题)

阅读全文
0 0