解决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 相关文章推荐
github配置使用指南
Nov 18 Python
Python用GET方法上传文件
Mar 10 Python
详解字典树Trie结构及其Python代码实现
Jun 03 Python
Python的Asyncore异步Socket模块及实现端口转发的例子
Jun 14 Python
Python 比较两个数组的元素的异同方法
Aug 17 Python
Python多进程multiprocessing用法实例分析
Aug 18 Python
python 读取.csv文件数据到数组(矩阵)的实例讲解
Jun 14 Python
复化梯形求积分实例——用Python进行数值计算
Nov 20 Python
PyQt5中向单元格添加控件的方法示例
Mar 24 Python
Python爬虫基于lxml解决数据编码乱码问题
Jul 31 Python
解决Jupyter-notebook不弹出默认浏览器的问题
Mar 30 Python
python实现监听键盘
Apr 26 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.vs.JAVA
2016/04/29 PHP
CodeIgniter框架基本增删改查操作示例
2017/03/23 PHP
phpcms配置列表页以及获得文章发布时间
2017/07/04 PHP
PHP7移除的扩展和SAPI
2021/03/09 PHP
Javascript 去除数组的重复元素
2010/05/04 Javascript
php对mongodb的扩展(初识如故)
2012/11/11 Javascript
Javascript setInterval的两种调用方法(实例讲解)
2013/11/29 Javascript
Node.js中创建和管理外部进程详解
2014/08/16 Javascript
WordPress中利用AJAX技术进行评论提交的实现示例
2016/01/12 Javascript
深入理解JavaScript中的call、apply、bind方法的区别
2016/05/30 Javascript
Vue中fragment.js使用方法详解
2017/03/09 Javascript
js实现网页的两个input标签内的数值加减(示例代码)
2017/08/15 Javascript
使用Angular CLI生成 Angular 5项目教程详解
2018/03/18 Javascript
详解VSCode配置启动Vue项目
2019/05/14 Javascript
NodeJs crypto加密制作token的实现代码
2019/11/15 NodeJs
微信小程序登陆注册功能的实现代码
2019/12/10 Javascript
JS document form表单元素操作完整示例
2020/01/13 Javascript
Vue 事件的$event参数=事件的值案例
2021/01/29 Vue.js
Python实现对excel文件列表值进行统计的方法
2015/07/25 Python
python django 实现验证码的功能实例代码
2017/05/18 Python
Python3解决棋盘覆盖问题的方法示例
2017/12/07 Python
Python文件常见操作实例分析【读写、遍历】
2018/12/10 Python
Python实现从SQL型数据库读写dataframe型数据的方法【基于pandas】
2019/03/18 Python
Python3.5基础之函数的定义与使用实例详解【参数、作用域、递归、重载等】
2019/04/26 Python
Python Pandas对缺失值的处理方法
2019/09/27 Python
Python爬虫定时计划任务的几种常见方法(推荐)
2021/01/15 Python
几个CSS3的flex弹性盒模型布局的简单例子演示
2016/05/12 HTML / CSS
2014年端午节演讲稿范文
2014/05/23 职场文书
电话客服专员岗位职责
2014/06/28 职场文书
乡镇领导班子四风整顿行动工作汇报
2014/10/25 职场文书
2014年内部审计工作总结
2014/12/09 职场文书
同学聚会邀请函
2015/01/30 职场文书
员工家属慰问信
2015/03/24 职场文书
幼儿园校车安全责任书
2015/05/08 职场文书
2019财务管理制度最新范本!
2019/07/09 职场文书
PostgreSQL解析URL的方法
2021/08/02 PostgreSQL