解決tensorflow讀取本地MNITS_data失敗的原因
MNITS_data 下載保存在本地,一定不要解壓!不要解壓!不要解壓!因?yàn)閕nput_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)
補(bǔ)充知識(shí):成功解決 \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)已棄用,將在將來的版本中刪除。
解決方法
更新說明:
請(qǐng)使用tensorflow/models 中的 official/mnist/dataset.py 等備選方案。
以上這篇解決tensorflow讀取本地MNITS_data失敗的原因就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
基于python解線性矩陣方程(numpy中的matrix類)
這篇文章主要介紹了基于python解線性矩陣方程(numpy中的matrix類),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-10-10opencv+tesseract實(shí)現(xiàn)驗(yàn)證碼識(shí)別的示例
本文主要介紹了opencv+tesseract實(shí)現(xiàn)驗(yàn)證碼識(shí)別的示例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-06-06用python打開攝像頭并把圖像傳回qq郵箱(Pyinstaller打包)
這篇文章主要介紹了用python打開攝像頭并把圖像傳回qq郵箱,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-05-05解決pytorch下出現(xiàn)multi-target not supported at的一種可能原因
這篇文章主要介紹了解決pytorch下出現(xiàn)multi-target not supported at的一種可能原因,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2021-02-02Python實(shí)現(xiàn)輕松找出兩個(gè)列表不同之處
在日常編程中,需要比較兩個(gè)列表并找出它們之間差異是一種常見需求,在本文中,我們將深入探討Python中查找兩個(gè)列表差異值的方法,需要的小伙伴可以參考下2023-12-12Python制作一個(gè)隨機(jī)抽獎(jiǎng)小工具的實(shí)現(xiàn)
最近在工作中面向社群玩家組織了一場(chǎng)活動(dòng),需要進(jìn)行隨機(jī)抽獎(jiǎng),就做了一個(gè)簡(jiǎn)單的隨機(jī)抽獎(jiǎng)小工具。具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-07-07