解決tensorflow讀取本地MNITS_data失敗的原因
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失敗的原因就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
python實戰(zhàn)之Scrapy框架爬蟲爬取微博熱搜
前面講解了Scrapy中各個模塊基本使用方法以及代理池、Cookies池。接下來我們以一個反爬比較強的網(wǎng)站新浪微博為例,來實現(xiàn)一下Scrapy的大規(guī)模爬取。2021-09-09
python網(wǎng)絡(luò)編程學(xué)習(xí)筆記(五):socket的一些補充
前面已經(jīng)為大家介紹了python socket的一些相關(guān)知識,這里為大家補充下,方便需要的朋友2014-06-06
關(guān)于Python的高級數(shù)據(jù)結(jié)構(gòu)與算法
這篇文章主要介紹了關(guān)于Python的高級數(shù)據(jù)結(jié)構(gòu)與算法,掌握這些數(shù)據(jù)結(jié)構(gòu)和算法將幫助我們在實際編程中解決各種問題,提高我們的編程技巧和水平,需要的朋友可以參考下2023-04-04

