Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find tensorflow.examples.tutorial #34083

Closed
wady101 opened this issue Nov 7, 2019 · 17 comments
Closed

Can't find tensorflow.examples.tutorial #34083

wady101 opened this issue Nov 7, 2019 · 17 comments
Assignees
Labels
TF 2.0 Issues relating to TensorFlow 2.0 type:bug Bug

Comments

@wady101
Copy link

wady101 commented Nov 7, 2019

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): None
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04.3 LTS
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: None
  • TensorFlow installed from (source or binary): Source
  • TensorFlow version (use command below): v1.12.1-17556-g63c45aacf3 2.0.0
  • Python version: Python 3.7.4
  • Bazel version (if compiling from source):0.27.1
  • GCC/Compiler version (if compiling from source):7.4.0
  • CUDA/cuDNN version: V10.1.243
  • GPU model and memory: GP107GL [Quadro P1000] -- 4031MiB

Describe the current behavior

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError:  No module named 'tensorflow.examples'

As the error sugests, can't find the module. Am I missing something while generating the wheel package from bazel?

Describe the expected behavior
Is there in the source code repo, hence should work. No monkey-fixes please. I have tried local copying the directory, but then some other tensorflow module is missing (tensorflow.contrib and goes on).

Code to reproduce the issue
python -c 'from tensorflow.examples.tutorials import input_data'

Other info / logs
bazel build --verbose_failures --config=monolithic //tensorflow/tools/pip_package:build_pip_package
Command I used to create the wheel package from tensorflow source.

@nikochiko
Copy link
Contributor

Yes. You should refer to this table and create wheel package with tested configuration.

@wady101
Copy link
Author

wady101 commented Nov 8, 2019

@nikochiko, I tried bezel 0.26.1 before this. It was stuck at the same issue.
I really doubt the version numbers is causing the problem here.

@oanush oanush self-assigned this Nov 8, 2019
@oanush oanush added TF 2.0 Issues relating to TensorFlow 2.0 type:bug Bug labels Nov 8, 2019
@oanush
Copy link

oanush commented Nov 8, 2019

Issue replicating for TF2.0 version.Kindly find the gist of colab.Thanks!

@ymodak
Copy link
Contributor

ymodak commented Nov 8, 2019

I believe there's a typo in your import.
Can you try with;
import tensorflow.examples.tutorials

@wady101 wady101 closed this as completed Nov 8, 2019
@tensorflow-bot
Copy link

tensorflow-bot bot commented Nov 8, 2019

Are you satisfied with the resolution of your issue?
Yes
No

@wady101
Copy link
Author

wady101 commented Nov 9, 2019

@ymodak It still doesn't work. Strangely, it was working in the colab link yesterday, but not today. Can you give this a try? I also tried it on the local build I have installed (build no. mentioned in the issue) and it still gives me a similar error.
I have updated the issue. I am getting two slightly different errors - I am definitely sure now, that I am missing something in my bezel install command.
The gist colab gives me:

from tensorflow.examples.tutorials.mnist import input_data
ModuleNotFoundError: No module named 'tensorflow.examples.tutorials'

Local build (build no. in issue) gives me:

from tensorflow.examples.tutorials.mnist import input_data
ModuleNotFoundError: No module named 'tensorflow.examples'

@wady101 wady101 reopened this Nov 9, 2019
@oanush oanush assigned ymodak and unassigned oanush Nov 11, 2019
@Leslie-Fang
Copy link
Contributor

@wady101 you need to set the PYTHONPATH
export PYTHONPATH=$tensorflow_examples_root

@wady101
Copy link
Author

wady101 commented Nov 13, 2019

@Leslie-Fang sorry, what is $tensorflow_examples_root? Couldn't find any mention of env variable online.

Also should I set this before building from source or after?

@Leslie-Fang
Copy link
Contributor

@wady101 I suspect it's because of all tensorflow version.
Did you write your benchmark or models by yourself?

@wady101
Copy link
Author

wady101 commented Nov 14, 2019

No @Leslie-Fang , I am trying to get a piece of code to run https://github.com/layog/Accurate-Binary-Convolution-Network

Still, what do I keep PYTHONPATH? Can you echo it on your pc and show it here? Thanks

@Leslie-Fang
Copy link
Contributor

@wady101 Sorry, I mis-read your error message.
I thought it was tensorflow_examples couldn't be find.

I suspect your error message relates with the tf version as you can see https://github.com/layog/Accurate-Binary-Convolution-Network is using TF1.4(tensorflow-gpu==1.4.1)

@wady101
Copy link
Author

wady101 commented Nov 14, 2019

@Leslie-Fang No worries. I have used the TF1.4.1, but that still doesn't work (I still get the same error message). The error message is always there for any version I use. I assume is there a flag I am missing when I am building from source?

@ymodak
Copy link
Contributor

ymodak commented Nov 22, 2019

TF 1.4.1 is obsolete. Please install latest version of TF and import again.
Current google colab hosts TF 1.15.0 version an can successfully import.
from tensorflow.examples.tutorials.mnist import input_data

@ymodak ymodak added the stat:awaiting response Status - Awaiting response from author label Nov 23, 2019
@wady101
Copy link
Author

wady101 commented Nov 23, 2019

@ymodak I have tried all three versions - 1.4.1, 1.12.1 and latest master branch - all three give me the same error (Using both "building from source" and "pip").
The two things I ask for is ;

  • Is there a flag being missed in the bezel command I have used to build tensorflow (see ISSUE)? Do I have to export some path to PYTHONPATH as mentioned by @Leslie-Fang ?
  • If not, is there a workaround which will solve my problem?

Repository I am trying to run - https://github.com/layog/Accurate-Binary-Convolution-Network/blob/master/ABC-layer-inference-support.ipynb [5th cell in Jupyter nb gives me error]
Thanks

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Nov 23, 2019
@wady101 wady101 closed this as completed Jan 3, 2020
@tensorflow-bot
Copy link

tensorflow-bot bot commented Jan 3, 2020

Are you satisfied with the resolution of your issue?
Yes
No

@oscar7692
Copy link

I'm using tensorflow-cpu==2.1.0 and I had the same issue

ModuleNotFoundError: No module named 'tensorflow.examples'

I solve this downloading manually the directory called "tutorials" from tensorflow repo
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/tutorials

and placed it in my virtual env directory
myenv\Lib\site-packages\tensorflow_core\examples\

after that it works fine

@PiyushChawla
Copy link

Thanks @oscar7692 worked for me as well that way. life saver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TF 2.0 Issues relating to TensorFlow 2.0 type:bug Bug
Projects
None yet
Development

No branches or pull requests

8 participants