Reputation: 11
Following this doc: , I am trying to run these lines after installing tensorflow with version 1.8.0 and python version is 2.7.13.
*import tensorflow as tf
tf.enable_eager_execution()*
I go to jupyter notebook in the top directory where tensorflow is installed and create a new jupyter notebook, and run the above lines, and got this error:
*---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-1ff77c8b7a69> in <module>()
1 import tensorflow as tf
2 from __future__ import absolute_import, division, print_function
----> 3 tf.enable_eager_execution()
AttributeError: 'module' object has no attribute 'enable_eager_execution'*
But when I access python from terminal, or use ipython, I can successfully run the two lines. Does anyone know why is this and how could I fix the issue in notebook?
Upvotes: 1
Views: 1574
Reputation: 11
I face this error while working on colab and I get rid of this error by resetting the environment by selecting the option 'Reset all runtimes' item from the Runtime menu.
Another method to get rid of this error is by executing the following in a code cell:
import tensorflow as tf
tf.enable_eager_execution()
Upvotes: 1