解决tensorflow读取本地MNITS_data失败的原因


Posted in Python onJune 22, 2020

MNITS_data 下载保存在本地,一定不要解压!不要解压!不要解压!因为input_data读取的是压缩包

>>>import tensorflow as tf
>>>from tensorflow.examples.tutorials.mnist import input_data
>>>input_data.read_data_stes("/home/wd/MNIST_data",one_hot=True)
WARNING:tensorflow:From <stdin>:1: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
WARNING:tensorflow:From /home/wd/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:260: maybe_download (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Please write your own downloading logic.
WARNING:tensorflow:From /home/wd/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:262: extract_images (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting /home/wd/MNIST_data/train-images-idx3-ubyte.gz
WARNING:tensorflow:From /home/wd/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:267: extract_labels (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting /home/wd/MNIST_data/train-labels-idx1-ubyte.gz
WARNING:tensorflow:From /home/wd/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:110: dense_to_one_hot (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.one_hot on tensors.
Extracting /home/wd/MNIST_data/t10k-images-idx3-ubyte.gz
Extracting /home/wd/MNIST_data/t10k-labels-idx1-ubyte.gz
WARNING:tensorflow:From /home/wd/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
>>> print(mnist.train.images.shape, mnist.train.labels.shape)
(55000, 784) (55000, 10)
>>> print(mnist.test.images.shape, mnist.test.labels.shape)
(10000, 784) (10000, 10)

补充知识:成功解决 \tensorflow\…\datasets\mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.lea

解决问题

\tensorflow\contrib\learn\python\learn\datasets\mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.

解决思路

警告位置:\tensorflow\contrib\learn\python\learn\datasets\mnist.py:290:

DataSet.__init__ 来自tensorflow.contrib.learn.python.learn.datasets.mnist)已弃用,将在将来的版本中删除。

解决方法

更新说明:

请使用tensorflow/models 中的 official/mnist/dataset.py 等备选方案。

以上这篇解决tensorflow读取本地MNITS_data失败的原因就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持三水点靠木。

Python 相关文章推荐
python实现文本去重且不打乱原本顺序
Jan 26 Python
CentOS下使用yum安装python-pip失败的完美解决方法
Aug 16 Python
python对于requests的封装方法详解
Jan 03 Python
如何在Django中添加没有微秒的 DateTimeField 属性详解
Jan 30 Python
Python同步遍历多个列表的示例
Feb 19 Python
深入解析python中的实例方法、类方法和静态方法
Mar 11 Python
python安装requests库的实例代码
Jun 25 Python
Django 中自定义 Admin 样式与功能的实现方法
Jul 04 Python
Python和Sublime整合过程图示
Dec 25 Python
详细分析Python collections工具库
Jul 16 Python
Python3+Appium安装及Appium模拟微信登录方法详解
Feb 16 Python
python数字图像处理数据类型及颜色空间转换
Jun 28 Python
python实现猜数游戏(保存游戏记录)
Jun 22 #Python
基于Tensorflow读取MNIST数据集时网络超时的解决方式
Jun 22 #Python
在Mac中配置Python虚拟环境过程解析
Jun 22 #Python
tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T
Jun 22 #Python
TensorFlow的环境配置与安装教程详解(win10+GeForce GTX1060+CUDA 9.0+cuDNN7.3+tensorflow-gpu 1.12.0+python3.5.5)
Jun 22 #Python
keras的load_model实现加载含有参数的自定义模型
Jun 22 #Python
python GUI模拟实现计算器
Jun 22 #Python
You might like
PHP实现变色验证码实例
2014/01/06 PHP
php使用百度ping服务代码实例
2014/06/19 PHP
跟我学Laravel之配置Laravel
2014/10/15 PHP
在Mac OS上搭建Nginx+PHP+MySQL开发环境的教程
2015/12/21 PHP
php代码架构的八点注意事项
2016/01/25 PHP
利用switch语句进行多选一判断的实例代码
2016/11/14 PHP
建议大家看下JavaScript重要知识更新
2007/07/08 Javascript
《JavaScript高级程序设计》阅读笔记(二) ECMAScript中的原始类型
2012/02/27 Javascript
JavaScript实现的字符串replaceAll函数代码分享
2015/04/02 Javascript
javascript顺序加载图片的方法
2015/07/18 Javascript
js实现input密码框提示信息的方法(附html5实现方法)
2016/01/14 Javascript
jQuery实现鼠标跟随效果
2017/02/20 Javascript
vue实现选项卡及选项卡切换效果
2018/04/24 Javascript
微信小程序实现红包雨功能
2018/07/11 Javascript
vue图片加载失败时用默认图片替换的方法
2019/08/29 Javascript
使用Vue生成动态表单
2019/11/26 Javascript
python下函数参数的传递(参数带星号的说明)
2010/09/19 Python
用Python程序抓取网页的HTML信息的一个小实例
2015/05/02 Python
django model去掉unique_together报错的解决方案
2016/10/18 Python
python编程实现归并排序
2017/04/14 Python
django反向解析URL和URL命名空间的方法
2018/06/05 Python
python RabbitMQ 使用详细介绍(小结)
2018/11/08 Python
对python中的six.moves模块的下载函数urlretrieve详解
2018/12/19 Python
python把1变成01的步骤总结
2019/02/27 Python
Python任意字符串转16, 32, 64进制的方法
2019/06/12 Python
如何使用Python自动生成报表并以邮件发送
2020/10/15 Python
结婚典礼证婚词
2014/01/11 职场文书
会计专业毕业自荐书范文
2014/02/08 职场文书
2014年预备党员学习两会心得体会
2014/03/17 职场文书
公司副总经理任命书
2014/06/05 职场文书
环保项目建议书
2014/08/26 职场文书
全国优秀教师事迹材料
2014/08/26 职场文书
停车位租赁协议书
2014/09/24 职场文书
作风整顿剖析材料
2014/09/30 职场文书
保研专家推荐信范文
2015/03/25 职场文书
《穷人》教学反思
2016/02/19 职场文书