2
votes

I have pip installed my tensorflow cpu version.

Name: tensorflow

Version: 2.0.0

Summary: TensorFlow is an open source machine learning framework for everyone.

Home-page: https://www.tensorflow.org/

Author: Google Inc.

Author-email: [email protected]

License: Apache 2.0

Location: c:\users\kulothungan\appdata\local\programs\python\python37\lib\site-packages

Requires: opt-einsum, astor, keras-applications, google-pasta, keras-preprocessing, numpy, tensorflow-estimator, wrapt, grpcio, six, gast, protobuf, wheel, termcolor, tensorboard, absl-py

Following is the code which I am trying to run

import tensorflow as tf

from tensorflow.examples.tutorials.mnist import input_data

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

Following is the error which I get when I try to run my code:

RESTART: C:\Users\Kulothungan\AppData\Local\Programs\Python\Python37\asfd.py Traceback (most recent call last): File "C:\Users\Kulothungan\AppData\Local\Programs\Python\Python37\asfd.py", line 2, in from tensorflow.examples.tutorials.mnist import input_data ModuleNotFoundError: No module named 'tensorflow.examples.tutorials'

Following is the location of my code:

C:\Users\Kulothungan\AppData\Local\Programs\Python\Python37

I have already tried putting it in tuorial folder as other posts have mentioned. Does anyone have any solution?

2
The tensorflow.examples.tutorials the module is not included in the pip package. You will find it in TF's GitHub repo.Shubham Panchal
Oh. Thanks. Should I download it and place in my directory?Kulothungan Senthil
You can clone the repository and then open the examples directory.Shubham Panchal
Thanks. This solved my issue.Can you post this as solution so I can close the question.Kulothungan Senthil

2 Answers

1
votes

The tensorflow.examples.tutorials the module is not included in the pip package. You will find it in TF's GitHub repo.

0
votes

If you can ! git clone https://github.com/tensorflow/tensorflow.git the TF GitHub repo and in the downloaded folders locate where the input_data.py file is then copy and paste it in the working directory of your project then import input_data on your python terminal, it will sort it out for you.

It works even on colab.

you can watch this beautiful video that helps to explain it even better: