I am writing the following code in Jupyter notebook.
import tensorflow as tf
g = tf.Graph()
And I encounter the following error while executing this simple code.
AttributeError: module 'tensorflow' has no attribute 'Graph'
If I execute the same from the console. It works. Any idea what's happening here.
More information:(test is my virtualenv)
ipython, jupyter, python version:
(test) xingzhou@xingzhou008:~/tensorflow$ which ipython3
/home/xingzhou/tensorflow/test/bin/ipython3
(test) xingzhou@xingzhou008:~/tensorflow$ which jupyter
/home/xingzhou/tensorflow/test/bin/jupyter
(test) xingzhou@xingzhou008:~/tensorflow$ which python3
/home/xingzhou/tensorflow/test/bin/python3
Execute from Console:
(test) xingzhou@xingzhou008:~/tensorflow$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> g = tf.Graph()
>>> type(g)
<class 'tensorflow.python.framework.ops.Graph'>
>>>