Kulothungan Senthil
Kulothungan Senthil

Reputation: 87

ModuleNotFoundError: No module named 'tensorflow.examples.tutorials'

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?

Upvotes: 3

Views: 9393

Answers (2)

theAfricanQuant
theAfricanQuant

Reputation: 63

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:

Upvotes: 0

Kulothungan Senthil
Kulothungan Senthil

Reputation: 87

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

Upvotes: 1

Related Questions