[英]Issue when trying to read MNIST data set
我將要學習神經網絡,並且要重現一個教程,該教程將訓練神經網絡,目標是識別手寫字母。 神經網絡的訓練應使用MNIST數據集進行。 不幸的是,由於我無法讀取MNIST數據集,所以問題出在哪里。 我使用的環境是Jupyter Notebook和Python 3。
這些是我擁有的代碼行(第2行導致了問題):
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot = True)
第2行導致此錯誤消息:
ModuleNotFoundError:沒有名為“ tensorflow.contrib”的模塊
好的,錯誤告訴我的是清楚的。 原因是,在我的tensorflow安裝文件夾中,目錄/ tensorflow / contrib / ...不存在。
問題是由第2行引起的,因為模塊input_data.py包含以下代碼行:
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
因此,我的問題的核心是,我不知道從哪里獲取模塊read_data_sets。 我在GitHub上搜索,但路徑/ tensorflow / contrib / learn / python / learn / datasets / mnist /不存在。
詳細信息:在GitHub中找不到子文件夾'mnist' 。 因此,我也找不到文件read_data_sets.py 。
因此,在哪里可以找到缺少的模塊“ read_data_sets” ?
如果有人可以幫助我,那就太好了,因為這個問題一開始就阻止了我與神經網絡打交道的嘗試。
非常感謝您,Matthias
似乎您使用的是新版本的tensorflow> = 1.13.0,因此如果要加載MNIST數據集,則可以單擊此鏈接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.