解决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爬虫神器Beautiful Soup用法
Jan 20 Python
python-opencv在有噪音的情况下提取图像的轮廓实例
Aug 30 Python
使用paramiko远程执行命令、下发文件的实例
Oct 01 Python
对python内置map和six.moves.map的区别详解
Dec 19 Python
python flask解析json数据不完整的解决方法
May 26 Python
Python列表与元组的异同详解
Jul 02 Python
Python中生成一个指定长度的随机字符串实现示例
Nov 06 Python
Python面向对象之继承原理与用法案例分析
Dec 31 Python
Python字典深浅拷贝与循环方式方法详解
Feb 09 Python
python实现录音功能(可随时停止录音)
Oct 26 Python
python 用struct模块解决黏包问题
Nov 07 Python
python高温预警数据获取实例
Jul 23 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中常见的mongodb查询操作
2013/06/20 PHP
composer.lock文件的作用
2016/02/03 PHP
获取任意Html元素与body之间的偏移距离 offsetTop、offsetLeft (For:IE5+ FF1 )[
2006/12/22 Javascript
jQuery+CSS 实现的超Sexy下拉菜单
2010/01/17 Javascript
JS模块与命名空间的介绍
2013/03/22 Javascript
jQuery获取iframe的document对象的方法
2014/10/10 Javascript
JavaScript实现添加及删除事件的方法小结
2015/08/04 Javascript
原生javascript实现分享到朋友圈功能 支持ios和android
2016/05/11 Javascript
浅谈JS继承_寄生式继承 &amp; 寄生组合式继承
2016/08/16 Javascript
简单分析javascript中的函数
2016/09/10 Javascript
Javascript for in的缺陷总结
2017/02/03 Javascript
微信小程序跨页面数据传递事件响应实现过程解析
2019/12/19 Javascript
[27:08]完美世界DOTA2联赛PWL S2 SZ vs Rebirth 第二场 11.21
2020/11/23 DOTA
Python创建二维数组实例(关于list的一个小坑)
2017/11/07 Python
python实现快速排序的示例(二分法思想)
2018/03/12 Python
Django保护敏感信息的方法示例
2019/05/09 Python
python实现关闭第三方窗口的方法
2019/06/28 Python
浅析Windows 嵌入python解释器的过程
2019/07/26 Python
Python中的上下文管理器相关知识详解
2019/09/19 Python
Python.append()与Python.expand()用法详解
2019/12/18 Python
Python安装依赖(包)模块方法详解
2020/02/14 Python
Python日期格式和字符串格式相互转换的方法
2020/02/18 Python
HTML5的结构和语义(1):前言
2008/10/17 HTML / CSS
html5使用canvas画空心圆与实心圆
2014/12/15 HTML / CSS
TCP/IP的分层模型
2013/10/27 面试题
Java软件工程师综合面试题笔试题
2013/09/08 面试题
酒店经理职责
2014/01/30 职场文书
副厂长岗位职责
2014/02/02 职场文书
数控专业个人求职信范文
2014/02/05 职场文书
2014年党员教师自我剖析材料
2014/09/30 职场文书
2014年扶贫帮困工作总结
2014/12/09 职场文书
骨干教师考核评语
2014/12/31 职场文书
2015年银行大堂经理工作总结
2015/04/24 职场文书
小平您好观后感
2015/06/09 职场文书
2016计划生育先进个人事迹材料
2016/02/29 职场文书
Golang并发工具Singleflight
2022/05/06 Golang