Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Machine Learning by (19k points)

I checked this out and realized that input_data was not built-in. So I downloaded the whole folder from here. How can I start the tutorial:

import input_data

mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)

---------------------------------------------------------------------------

ImportError                               Traceback (most recent call last)

<ipython-input-6-a5af65173c89> in <module>()

----> 1 import input_data

      2 mnist = tf.input_data.read_data_sets("MNIST_data/", one_hot=True)

ImportError: No module named input_data

I'm using iPython (Jupyter) so do I need to change my working directory to this folder I downloaded? or can I add this to my tensorflow directory? If so, where do I add the files? I installed tensorflow with pip (on my OSX) and the current location is ~/anaconda/lib/python2.7/site-packages/tensorflow/__init__.py

Are these files meant to be accessed directly through tensorflow like sklearn datasets? or am I just supposed to cd into the directory and work from there? The example is not clear.

1 Answer

0 votes
by (33.1k points)

Let’s say, you have a directory: /somePath/tensorflow/tutorial, on which you want to work.

So you have to download input_data.py.

For example:

import input_data

mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)

Here main.py is also in this directory.

Whenever this is done, you can just start running main.py which will start downloading the files and will put them in the MNIST_data folder.

Hope this answer helps.

To learn what is machine learning and application of machine learning, visit the machine learning course by Intellipaat.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...