import input_data MNIST tensorflow not working import input_data MNIST tensorflow not working python python

import input_data MNIST tensorflow not working


So let's assume that you are in the directory: /somePath/tensorflow/tutorial (and this is your working directory).

All you need to do is to download the input_data.py file and place it like this. Let's assume that the file name you invoke:

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

is main.py and it is also in the same directory.

Once 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 (once they are there the script will not be downloading them next time).


The old tutorial said, to import the MNIST data, use:

import input_datamnist = input_data.read_data_sets('MNIST_data', one_hot=True)

This will cause the error.The new tutorial uses the following code to do so:

from tensorflow.examples.tutorials.mnist import input_datamnist = input_data.read_data_sets("MNIST_data", one_hot=True)

And this works well.


How can I start the tutorial

I didn't download the folder you did but I installed tensorflow by pip and then I had similar problem.

My workaround was to replace

import tensorflow.examples.tutorials.mnist.input_data

with

import tensorflow.examples.tutorials.mnist.input_data as input_data