Reputation: 5
I am about to learn about Neural Networks and I am about to reproduce a tutorial which trains a Neural Network with the target to identify handwritten letters. The training of the Neural Network should be done with the MNIST data set. Unfortunately, exactly where my issue comes as I am not able to read in the MNIST data set. The environment I am using is a Jupyter Notebook and Python 3.
These are the lines of code I have (line 2 causes the issue):
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot = True)
Line 2 causes this error message:
ModuleNotFoundError: No module named 'tensorflow.contrib'
Ok, what the error tells me, is clear. Reason is, that in my tensorflow installation folder a directory /tensorflow/contrib/... does not exist.
The issues is caused by line 2, as the module input_data.py contains this line of code:
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
So, the core of my issue is, that I do not know, where to get the module read_data_sets from. I was searching at GitHub, but the path /tensorflow/contrib/learn/python/learn/datasets/mnist/ does not exist there.
In detail: Subfolder 'mnist' is not to be found in GitHub. Therefore, I also do not find the file read_data_sets.py.
So, where do I find the missing module 'read_data_sets'?
Would be great, if someone could help me as this issue stops my attempt to deal with Neural Networks already at the very beginning.
Thanks a lot and kind regards, Matthias
Upvotes: 0
Views: 448
Reputation: 453
It seems that you are using a new version of tensorflow >= 1.13.0 so you may follow this link if you want to load MNIST dataset
Upvotes: 1