[TF 2.0] tf.estimator import error

1,216 views
Skip to first unread message

Paige Bailey

unread,
Feb 13, 2019, 12:53:19 PM2/13/19
to TensorFlow Community Testing, Mustafa Mustafa, Goldie Gadde
TF 2.0 Testers -
For everyone using the tf-nightly-2.0-preview for tf.estimator.Estimator(): the build has been broken since February 12th, and is being actively worked on. If you have experienced an issue with importing estimators, you are not alone!

Thanks to +Mustafa Mustafa for reporting the issue, and for +Goldie Gadde for working on the fix. I will update this post as soon as the issue is resolved, and you can track #25723.

Detailed example of the problem:
>>> import tensorflow as tf
>>> import tensorflow_estimator.python.estimator.api._v2.estimator
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/__init__.py", line 25, in <module>
    import tensorflow_estimator.python.estimator.estimator_lib
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator_lib.py", line 54, in <module>
    from tensorflow_estimator.python.estimator.mode_keys import ModeKeysV2
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/mode_keys.py", line 22, in <module>
    from tensorflow.python.training.mode_keys import ModeKeys
ModuleNotFoundError: No module named 'tensorflow.python.training.mode_keys'
>>> tf.__version__
'2.0.0-dev20190213'
>>> 
>>> exit()
Thanks again for your great work, and for testing!
.pb

--

Paige Bailey   

Developer Advocate (TensorFlow)

@DynamicWebPaige

webp...@google.com


 

Paige Bailey

unread,
Feb 14, 2019, 1:59:39 AM2/14/19
to TensorFlow Community Testing, Mustafa Mustafa, Goldie Gadde
The issue has been resolved, and a new v2 estimator package is now available for use.

Thanks!
.pb

Mustafa Mustafa

unread,
Feb 14, 2019, 2:04:55 AM2/14/19
to Paige Bailey, TensorFlow Community Testing, Goldie Gadde
Great! Thank you for the update.
I will wait for the nightly build to test.

-- Mustafa

Mustafa Mustafa

unread,
Feb 14, 2019, 1:50:56 PM2/14/19
to Paige Bailey, TensorFlow Community Testing, Goldie Gadde
Is there a way to check the status of the nightly build? I don't think today's is available yet.

-- Mustafa

Goldie Gadde

unread,
Feb 14, 2019, 2:51:22 PM2/14/19
to Mustafa Mustafa, Paige Bailey, TensorFlow Community Testing
Hi Mustafa, 
The builds were delayed today. They should be available now. I dont know if there is a way to make the status of the build available externally.

Thanks,
Goldie




Mustafa Mustafa

unread,
Feb 14, 2019, 2:52:58 PM2/14/19
to Goldie Gadde, Paige Bailey, TensorFlow Community Testing
Thanks for now Goldie. I will continue the tests later today.

Mustafa Mustafa

unread,
Feb 15, 2019, 12:02:30 PM2/15/19
to Goldie Gadde, Paige Bailey, TensorFlow Community Testing
Hmmm, I feel I might be missing something; the module is still not available in today's build.

mustafa@maeve:~/tf_v2_tests$ python -c "import tensorflow as tf; print(tf.__version__); tf.estimator.Estimator()"
Limited tf.compat.v2.summary API due to missing TensorBoard installation
Limited tf.summary API due to missing TensorBoard installation
2.0.0-dev20190215
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'estimator'


-- Mustafa

Paige Bailey

unread,
Feb 15, 2019, 12:12:11 PM2/15/19
to Mustafa Mustafa, Goldie Gadde, TensorFlow Community Testing
Hi, Mustafa -
Could you please try again, running each of your statements individually?
I'm able to see tf.estimator.Estimator() in my version (also 2.0.0-dev20190215):

Screenshot from 2019-02-15 09-08-50.png

Mustafa Mustafa

unread,
Feb 15, 2019, 12:17:16 PM2/15/19
to Paige Bailey, Goldie Gadde, TensorFlow Community Testing
Thank you for testing Paige. It still doesn't work, see below. 

Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf 
Limited tf.compat.v2.summary API due to missing TensorBoard installation
Limited tf.summary API due to missing TensorBoard installation
>>> tf.__version__
'2.0.0-dev20190215'
>>> help(tf.estimator)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'estimator'
>>> 

-- Mustafa

Mustafa Mustafa

unread,
Feb 15, 2019, 12:56:56 PM2/15/19
to Paige Bailey, Goldie Gadde, TensorFlow Community Testing
It works on a different machine. Something odd is going on. Both have the same tf.__git_version__ hash. Must be an issue on my end.

-- Mustafa

Paige Bailey

unread,
Feb 15, 2019, 1:01:50 PM2/15/19
to Mustafa Mustafa, Goldie Gadde, TensorFlow Community Testing
Thanks for the update, Mustafa! This sounds like it could be a potential environment issue, or a snag with the build. Let us know what you find out!

--
You received this message because you are subscribed to the Google Groups "TensorFlow Community Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testing+u...@tensorflow.org.

Mustafa Mustafa

unread,
Feb 15, 2019, 1:12:22 PM2/15/19
to Paige Bailey, Goldie Gadde, TensorFlow Community Testing
Fixed.
For some reason, when I uninstall the previous build and reinstall, it doesn't clean up the estimator package installation.

/> pip3 uninstall tf-nightly-gpu-2.0-preview
/> ls ...site-packages/ 
drwxr-xr-x  5 mustafa dl 4.0K Feb  7 13:05 tensorflow_estimator
drwxr-xr-x  2 mustafa dl 4.0K Feb  7 13:05 tensorflow_estimator_2.0_preview-1.13.0.dev2019012800.dist-info
/> pip3 install tf-nightly-gpu-2.0-preview
/> python -c "import tensorflow as tf; print(tf.__version__); tf.estimator.Estimator()"
2.0.0-dev20190215
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'estimator'


Cleaning up:
/> pip3 uninstall tf-nightly-gpu-2.0-preview
/> rm -rf .../site-packages/tensorflow_estimator*
/> pip3 install tf-nightly-gpu-2.0-preview
/> python -c "import tensorflow as tf; print(tf.__version__); tf.estimator.Estimator()"
2.0.0-dev20190215
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: __init__() missing 1 required positional argument: 'model_fn'


tensorflow_estimator_2.0_preview-1.13.0.dev2019012800.dist-info
-- Mustafa

Paige Bailey

unread,
Feb 15, 2019, 1:22:08 PM2/15/19
to Mustafa Mustafa, Goldie Gadde, TensorFlow Community Testing
Beautiful! Thank you, Mustafa - and feel free to reach out (chat or email) if you run into any snags. 😊

Martin Wicke

unread,
Feb 15, 2019, 1:59:12 PM2/15/19
to Mustafa Mustafa, Paige Bailey, Goldie Gadde, TensorFlow Community Testing
If you "pip install -U" on reinstall, would that work?

Mustafa Mustafa

unread,
Feb 15, 2019, 2:13:01 PM2/15/19
to Martin Wicke, Paige Bailey, Goldie Gadde, TensorFlow Community Testing
Yes, this seems to work. But I might not have been able to reproduce the exact "stale" environment I had earlier. 

-- Mustafa

Reply all
Reply to author
Forward
0 new messages