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

TF2 Nightly-20190607 broken import #29536

Closed
seanpmorgan opened this issue Jun 7, 2019 · 4 comments
Closed

TF2 Nightly-20190607 broken import #29536

seanpmorgan opened this issue Jun 7, 2019 · 4 comments
Assignees

Comments

@seanpmorgan
Copy link
Member

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): tf_nightly_2.0_preview-2.0.0.dev20190607
  • Python version: Python2 / Python3

Describe the current behavior
TF2 nightly breaks with this error:

File "/usr/lib/python2.7/site-packages/tensorflow/__init__.py", line 93, in <module>
    from tensorflow_core import *
AttributeError: 'module' object has no attribute 'compiler

Code to reproduce the issue

pip install tf-nightly-2.0-preview
python -c "import tensorflow as tf"

Other info / logs
Probably related to the commit mentioned in #29532 but not positive.

@mihaimaruseac mihaimaruseac self-assigned this Jun 7, 2019
@mihaimaruseac
Copy link
Collaborator

Sorry about that, I'll fix today

@mihaimaruseac
Copy link
Collaborator

This is now fixed, I have 3 more other issues caused by the virtual pip that needs fixing but I'll keep an eye.

Please let me know if this still doesn't work.

wchargin added a commit to tensorflow/tensorboard that referenced this issue Jun 7, 2019
Summary:
Due to <tensorflow/tensorflow#29536>.

This unblocks our CI until tomorrow’s nightlies are pushed.

Test Plan:
Fingers crossed.

wchargin-branch: pin-20190606-nightly
wchargin added a commit to tensorflow/tensorboard that referenced this issue Jun 7, 2019
Summary:
Due to <tensorflow/tensorflow#29536>.

This unblocks our CI until tomorrow’s nightlies are pushed.

Test Plan:
Fingers crossed.

wchargin-branch: pin-20190606-nightly
@EziamaUgonna
Copy link

Hello I am getting this issue from TF 2.0 in Google Colab. The code was running previously, but all of a sudden, it started outputting this error as shown below.

AttributeError Traceback (most recent call last)
in ()
11 #from hyperopt import fmin, tpe, hp, STATUS_OK, STATUS_FAIL, Trials
12 #import python_utils
---> 13 import tensorflow as tf
14 import tensorflow_probability as tfp
15 tfd = tfp.distributions

/usr/local/lib/python3.6/dist-packages/tensorflow/init.py in ()
91
92 # We still need all the names that are toplevel on tensorflow_core
---> 93 from tensorflow_core import *
94
95 # We also need to bring in keras if available in tensorflow_core

AttributeError: module 'tensorflow_core' has no attribute 'compiler'

@seanpmorgan
Copy link
Member Author

Hi @EziamaUgonna, install yesterday's nightly with pip install tf-nightly-2.0-preview==2.0.0.dev20190606 or alternatively it should be fixed on tomorrow's version.

sleighsoft pushed a commit to sleighsoft/tensorflow that referenced this issue Jun 12, 2019
This fix is required as the API generation job doesn't check that `__all__` has been initialized to contain the `core`, `compiler` and `python` symbols just a little before these symbols are deleted. As a result, when someone does `from tensorflow import *`, the interpreter sees these symbols in `tensorflow.__all__` and tries to bring them up in scope. However, as they are deleted this fails.

5a93bb solved this issue for V1 API and the issue surfaced for V2 API with f1ffa02, the virtual pip package change.

PiperOrigin-RevId: 252060393
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants