Installing TensorFlow on Ubuntu/Google Cloud Platform

What is TensorFlow? Most probably you know perfect the answer but if you are new(according to google):

TensorFlow is an open-source software library for Machine Intelligence.

It's one of the most popular software libraries out there for AI(artificial intelligence). You can follow the very detailed instruction from: Installing TensorFlow

Google Cloud Platform is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user ..

This is a description for Google Cloud Platform found on Wikipedia. It's a good combination to use them for AI projects without the need to invest for hardware. GCP offers 300 $ as a trial amount if you want to try their platform: Free TrialThis can be enough for weeks of training neural network.

Python is a very popular programming language. It is very useful in big range of areas and has a design that emphasizes code readability and simplicity. It is widely considered to be relatively easy programming language to learn and master because of its focus on readability.

Pre-Flight Notes

  • These instructions are intended specifically for installing TensorFlow.
  • I’ll be working from a Ubuntu 14.04 LTS server, and I’ll be logged in as non-root user.
  • Connection is done through SSH(with key authorization).

1 install required libraries - zip, python3-pip and python3-dev

sudo apt-get -y install zip
sudo apt-get -y install python3-pip python3-dev

2 install tensor flow - check for the version that you need. Here it is:

  • version - 1.0.1
  • python - 3
  • 64 bit version
sudo pip3 install --upgrade

3 install required libraries - python-pip python-dev python-virtualenv

sudo apt-get install python-pip python-dev python-virtualenv

4 set virtual environment

virtualenv --system-site-packages ~/tensorflow

5 Activate tensorflow

source ~/tensorflow/bin/activate

6 Prepare training session

cd your-rnn-package
(if you want the script to continue after exiting current session use - nohup command)
sudo nohup python3

7 Sample


8 Deactivate tensorflow


9 Connect with ssh(depending on your settings

10 All commands unformatted

  ssh -p 22 [email protected]
  sudo apt-get -y install zip
  sudo apt-get -y install python3-pip python3-dev
  sudo pip3 install --upgrade
  sudo apt-get -y install python-pip python-dev python-virtualenv
  virtualenv --system-site-packages ~/tensorflow
  source ~/tensorflow/bin/activate
  sudo mkdir sample
  sudo chown -R myuser:myuser /home/sample/
  sudo mkdir /home/myuser/working
  sudo unzip /home/sample/
  cd my-rnn-package/data/sampledata/
  sudo cp /home/sample/input.txt .
  sudo python3
  sudo nohup python3
  sudo rm -r /home/myuser/working/my-rnn-package/

  sudo tail -f -n 100 /home/myuser/working/my-rnn-package/nohup.out
Share Tweet Send