Skip to content

Estimator 1.x nightlies break tf.contrib.* #32621

@wchargin

Description

@wchargin

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): gLinux (like Debian)
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): v1.12.1-9365-gff401a6 1.15.0-dev20190821
  • Python version: Python 3.6.8
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): N/A
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

Describe the current behavior

On TF 1.x nightlies, tf.contrib.summary fails to import due to an error
importing something from estimator:

$ cd "$(mktemp -d)"
$ virtualenv -q -p python3.6 ./ve
$ . ./ve/bin/activate
(ve) $ pip install -q tf-nightly==1.15.0.dev20190821
(ve) $ pip freeze | grep -e tensor -e tf- -e tb-
tb-nightly==1.15.0a20190911
tf-estimator-nightly==1.14.0.dev2019091801
tf-nightly==1.15.0.dev20190821
(ve) $ python -c 'import tensorflow as tf; tf.contrib.summary'
WARNING:tensorflow:

  TensorFlow's `tf-nightly` package will soon be updated to TensorFlow 2.0.

  Please upgrade your code to TensorFlow 2.0:
    * https://www.tensorflow.org/beta/guide/migration_guide

  Or install the latest stable TensorFlow 1.X release:
    * `pip install -U "tensorflow==1.*"`

  Otherwise your code may be broken by the change.

  
WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/tmp.pTt6GXwXDC/ve/lib/python3.6/site-packages/tensorflow_core/python/util/lazy_loader.py", line 63, in __getattr__
    return getattr(module, item)
  File "/tmp/tmp.pTt6GXwXDC/ve/lib/python3.6/site-packages/tensorflow/__init__.py", line 50, in __getattr__
    module = self._load()
  File "/tmp/tmp.pTt6GXwXDC/ve/lib/python3.6/site-packages/tensorflow/__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "/tmp/tmp.pTt6GXwXDC/ve/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/tmp/tmp.pTt6GXwXDC/ve/lib/python3.6/site-packages/tensorflow_core/contrib/__init__.py", line 48, in <module>
    from tensorflow.contrib import estimator
  File "/tmp/tmp.pTt6GXwXDC/ve/lib/python3.6/site-packages/tensorflow_core/contrib/estimator/__init__.py", line 30, in <module>
    from tensorflow_estimator.contrib import estimator
ModuleNotFoundError: No module named 'tensorflow_estimator.contrib'

Describe the expected behavior

It should be possible to force tf.contrib, as was possible with yesterday’s
tensorflow-estimator-nightly.

$ pip freeze | grep -e tensor -e tf- -e tb-
tb-nightly==1.15.0a20190911
tf-estimator-nightly==1.14.0.dev2019091701
tf-nightly==1.15.0.dev20190821
$ python -c 'import tensorflow as tf; tf.contrib.summary'  # works

Code to reproduce the issue

python -c 'import tensorflow as tf; tf.contrib.summary'

Other info / logs

This is blocking TensorBoard builds and nightlies.

Googlers, see http://b/140485848#comment35.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions