解决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使用itchat实现手机控制电脑
Feb 22 Python
Python实现查看系统启动项功能示例
May 10 Python
Python3实现对列表按元组指定列进行排序的方法分析
Dec 22 Python
使用Python 统计高频字数的方法
Jan 31 Python
python pandas模块基础学习详解
Jul 03 Python
详解Pandas之容易让人混淆的行选择和列选择
Jul 10 Python
Python中sorted()排序与字母大小写的问题
Jan 14 Python
python函数定义和调用过程详解
Feb 09 Python
Python使用QQ邮箱发送邮件实例与QQ邮箱设置详解
Feb 18 Python
Django-imagekit的使用详解
Jul 06 Python
python 读取串口数据的示例
Nov 09 Python
Python+Xlwings 删除Excel的行和列
Dec 19 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
PHP4实际应用经验篇(9)
2006/10/09 PHP
php加密算法之实现可逆加密算法和解密分享
2014/01/21 PHP
10个php函数实用却不常见
2015/10/13 PHP
学习php设计模式 php实现门面模式(Facade)
2015/12/07 PHP
PHP对象、模式与实践之高级特性分析
2016/12/08 PHP
ThinkPHP3.2.3框架邮件发送功能图文实例详解
2019/04/23 PHP
禁用页面部分JavaScript方法的具体实现
2013/07/31 Javascript
对table和ul实现js分页示例分享
2014/02/24 Javascript
[原创]推荐10款最热门jQuery UI框架
2014/08/19 Javascript
使用jQuery jqPlot插件绘制柱状图
2014/12/18 Javascript
使用jQuery Ajax 请求webservice来实现更简练的Ajax
2016/08/04 Javascript
简单实现js悬浮导航效果
2017/02/05 Javascript
JavaScript EventEmitter 背后的秘密 完整版
2018/03/29 Javascript
Angular服务Request异步请求的实例讲解
2018/08/13 Javascript
JS原型对象操作实例分析
2020/06/06 Javascript
在Python的Bottle框架中使用微信API的示例
2015/04/23 Python
Python合并字符串的3种方法
2015/05/21 Python
使用Python编写简单的画图板程序的示例教程
2015/12/08 Python
Python的SQLalchemy模块连接与操作MySQL的基础示例
2016/07/11 Python
python3.6+opencv3.4实现鼠标交互查看图片像素
2018/02/26 Python
Python3.4 tkinter,PIL图片转换
2018/06/21 Python
详解python3中用HTMLTestRunner.py报ImportError: No module named 'StringIO'如何解决
2019/08/27 Python
python单向链表的基本实现与使用方法【定义、遍历、添加、删除、查找等】
2019/10/24 Python
Django Admin 上传文件到七牛云的示例代码
2020/06/20 Python
canvas实现二维码和图片合成的示例代码
2018/08/01 HTML / CSS
Ajax和javascript的区别
2013/07/20 面试题
初婚初育证明
2014/01/14 职场文书
初中同学聚会感言
2014/02/11 职场文书
岗位职责怎么写
2014/03/14 职场文书
共青团员自我评价范文
2014/09/14 职场文书
工地材料员岗位职责
2015/04/11 职场文书
优秀毕业生主要事迹材料
2015/11/04 职场文书
七夕情人节问候语
2015/11/11 职场文书
使用springboot暴露oracle数据接口的问题
2021/05/07 Oracle
浅谈JS的原型和原型链
2021/06/04 Javascript
如何通过cmd 连接阿里云服务器
2022/04/18 Servers