解决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中pycurl库的用法实例
Sep 30 Python
python实现登陆知乎获得个人收藏并保存为word文件
Mar 16 Python
python实现数独算法实例
Jun 09 Python
Python requests模块实例用法
Feb 11 Python
Python生成指定数量的优惠码实操内容
Jun 18 Python
Python编程实现tail-n查看日志文件的方法
Jul 08 Python
使用python 的matplotlib 画轨道实例
Jan 19 Python
Pycharm debug调试时带参数过程解析
Feb 03 Python
python调用HEG工具批量处理MODIS数据的方法及注意事项
Feb 18 Python
Python random库使用方法及异常处理方案
Mar 02 Python
python 获取当前目录下的文件目录和文件名实例代码详解
Mar 10 Python
Python FuzzyWuzzy实现模糊匹配
Apr 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获取地址栏信息的代码
2008/10/08 PHP
php浏览历史记录的方法
2015/03/10 PHP
php编写的抽奖程序中奖概率算法
2015/05/14 PHP
php连接微软MSSQL(sql server)完全攻略
2016/11/27 PHP
使用EXT实现无刷新动态调用股票信息
2008/11/01 Javascript
javascript 自动转到命名锚记
2009/01/10 Javascript
javascript document.execCommand() 常用解析
2009/12/14 Javascript
JavaScript 学习笔记(十五)
2010/01/28 Javascript
js获取键盘按键响应事件(兼容各浏览器)
2013/05/16 Javascript
Jquery实现图片左右自动滚动示例
2013/09/25 Javascript
js实现C#的StringBuilder效果完整实例
2015/12/22 Javascript
JavaScript中绑定事件的三种方式及去除绑定
2016/11/05 Javascript
JS滚动到指定位置导航栏固定顶部
2017/07/03 Javascript
vue2.0的虚拟DOM渲染思路分析
2018/08/09 Javascript
关于在vue 中使用百度ueEditor编辑器的方法实例代码
2018/09/14 Javascript
Javascript的this详解
2019/03/23 Javascript
Vue 动态添加路由及生成菜单的方法示例
2019/06/20 Javascript
简单谈谈javascript高级特性
2019/09/04 Javascript
微信小程序仿淘宝热搜词在搜索框中轮播功能
2020/01/21 Javascript
JS继承实现方法及优缺点详解
2020/09/02 Javascript
Python中SOAP项目的介绍及其在web开发中的应用
2015/04/14 Python
Python基础之文件读取的讲解
2019/02/16 Python
pytorch 修改预训练model实例
2020/01/18 Python
html5自定义video标签的海报与播放按钮功能
2019/12/04 HTML / CSS
LA MER海蓝之谜美国官网:传奇面霜
2016/08/27 全球购物
美国顶级户外凉鞋品牌:Chacos
2017/03/27 全球购物
Under Armour安德玛意大利官网:美国高端运动科技品牌
2020/01/16 全球购物
什么是封装
2013/03/26 面试题
仓库管理专业个人自我评价范文
2013/11/11 职场文书
市三好学生主要事迹
2014/01/28 职场文书
餐饮部总监岗位职责范文
2014/02/13 职场文书
企业授权委托书范本
2014/09/22 职场文书
学生未请假就回家检讨书
2014/09/22 职场文书
2015年实习生工作总结报告
2015/04/28 职场文书
详解Python+OpenCV绘制灰度直方图
2022/03/22 Python
Hive导入csv文件示例
2022/06/25 数据库