Skip to content

Instantly share code, notes, and snippets.

@daj
Last active August 1, 2018 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daj/6d920efcea19fda927e4b69b75643399 to your computer and use it in GitHub Desktop.
Save daj/6d920efcea19fda927e4b69b75643399 to your computer and use it in GitHub Desktop.
Check Python can import TensorFlow dependencies
# This script assumes you are running from Terminal / command line
python
import tensorflow as tf
hello = tf.constant('Hello from TensorFlow. Everything seems to be working!')
sess = tf.Session()
print(sess.run(hello))
exit()
@noumanschaudhry
Copy link

the script in your first post worked fine without any errors.

but i am facing this when I run my code :

anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in ()
3 from future import print_function
4
----> 5 import tensorflow as tf
6 from tensorflow.python.framework import ops as tf_ops
7 from tensorflow.python.training import moving_averages

anaconda3/lib/python3.6/site-packages/tensorflow/init.py in ()
598 # resolution to succeed.
599 # pylint: disable=undefined-variable
--> 600 del python
601 del core
602 # pylint: enable=undefined-variable

NameError: name 'python' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment