Tensorflow Python Setup on DigitalOcean

The following steps will install TensorFlow1 on a fresh Digital Ocean virtual machine running Ubuntu.

This is straight from the installation guide, but summarized for this environment (correct python version / no GPU).

apt-get update && apt-get upgrade
apt-get install python-pip python-dev python-virtualenv

pip install --upgrade pip

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl

pip install --upgrade $TF_BINARY_URL

Then to test it:

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))
  1. https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#pip-installation []

2 Replies to “Tensorflow Python Setup on DigitalOcean”

  1. Thank you. This works fine as long as you get a machine with at least 1Gb of RAM, the smallest droplets, with 512Mb, will cause the final step to fail.

Leave a Reply

Your email address will not be published. Required fields are marked *