I'm trying to run a TensorFlow tutorial.
I need to execute the following command to fetch the learning data here.
from tensorflow.examples.tutorials.mnist import input_data</code></pre> <p><br /> An error will occur as shown below.</p> <pre><code data-language = "Python">>>>from tensorflow.examples.tutorials.mnist import input_data Traceback (most recent call last): File "<stdin>", line 1, in<module> ImportError: No module named examples.tutorials.mnist
An error will occur if the contents of input_data are copied from the following and imported.
>>>import input_data Traceback (most recent call last): File "<stdin>", line 1, in<module> File "input_data.py", line 29, in<module> from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets ImportError: No module named contrib.learn.python.learn.datasets.mnist
In the first place, I think that I can't import anything from outside, but I don't know how to deal with it.
If anyone knows how to handle this [No module named xxxxxx], please teach me.
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
Answer # 1
from tensorflow.examples.tutorials.mnist The error is
ImportError: No module named examples.tutorials.mnistfor
tesorflow< It looks like you have an import named/code>.
It is a good idea to check the location of the file by appending
import tensorflow print (tensorflow .__ file __)
, and check the actual procedure.
Usually points to a location like
.../lib/pythonX.Y/site-packages/tensorflow/__ init __. pyunder
site-packagesmust. (X and Y are version numbers)
If you put a file named
tensorflow.pyin the current directory and
import tensorflowpoints to that file, or you make a mistake like that, The
Answer # 2
I tried the exact same procedure on another Mac and it worked without any problems.
I'm sorry, I don't know the cause at all, but there seems to be a problem with the execution environment.
Since it moved, I will close it for the time being.
Thank you all.
Answer # 3
Check here for a similar case
- about import from another directory in python
- python - tensorflow importerror
- python - error in joblib import of sklearnexternals
- python - built-in module, can't import
- python - is there a way to copy the numbers from the 5,1 array into a 5,5 array with tensorflow?
- python - tweepy import error
- python - regarding how to import modules
- Python import package through folder
- ASPNET open source import and export library MagicodesIE complete Csv import and export method
- i want to operate (remote) python by linking with two pc
- python 3x - is this source code written properly?
- python - i can't import mglearn with jupyter notebook
- python - error in cython pxy import (windows) is the space in the file path a problem?
- error about python module import
- how to avoid import error in python 3x
- how to import so that datetimedatetoday() can be used in python
- python - tweepy import error
- python - the email source from django is [email protected]
- python 3x - importerror: attempted relative import with no known parent package
- python - error with import torch
- anomaly detection using own data set by python
- python - delete tensorflow installed with pip
- python - error in cnn implementation in keras
- python - i want to resolve typeerror: cannot handle this data type: (1, 1, 3), <f8
- i want the gpu to calculate python processing
- python - i want to create my own activation function called siren with keras
- python - keras/tensorflow custom layer call method cannot be called
- gpu in python-path doesn't pass-
- python - about permission error in shutilpy
- image classification method using python