Installing and setting up Tensorflow was a little bit of a hastle for me, eadling with Python versions. Here is a quick shell script that automates Tensorflow installation.

It works on Amazon Linux and CentOS. I presume it can work on Ubuntu if you switch the yum install with the correct apt-get packages.

Also watch out for the TF_BINARY_URL and make sure you choose the right Linux architecture. You can always browse through the list of packages here:

This last part in the script easily tests that Tensorflow is running corerctly. It runs a small session with nothing but a constant.

# testing tensorflow
python -c "import os; \
import tensorflow as tf; \
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'; \
c = tf.constant('Tensorflow works!'); \
sess = tf.Session(); \