tensorflow

Introduction:

TENSORFLOW is an interface for expressing machine learning
algorithms, and an implementation for executing such algorithms.

A computation expressed using TENSORFLOW can be
executed with little or no change on a wide variety of heterogeneous
systems, ranging from mobile devices such as phones
and tablets up to large-scale distributed systems of hundreds
of machines and thousands of computational devices such as
GPU cards. The system is flexible and can be used to express
a vast assortment of algorithms, including training and inference
algorithms for deep neural network models.

TENSORFLOW has been used for research and machine learning in areas such as

  • speech recognition;
  • computer vision;
  • robotics;
  • information retrieval;
  • natural language processing;
  • geographic information extraction;
  • computational drug discovery.

Web site:

The home page at tensorflow.org:

https://www.tensorflow.org/

Reference:

Usage:

ARC has not installed TENSORFLOW on any cluster. Therefore, it is
necessary for any interested user to install and run their own version.
Directions for doing so on the ARC clusters Cascades and NewRiver
are given below.

Cascades Installation:

In this example, the user has decided to create a subdirectory
tfcascades into which to install TENSORFLOW. The user
should log in interactively to Cascades and issue the following commands:

      module purge
      module load Anaconda/2.3.0
      module load cuda/8.0.44 
      module load cudnn/5.1

      # Type y and hit enter when prompted with "Proceed ([y]/n)?"
      conda create -n tfcascades anaconda

      source activate tfcascades

      # ignore the warning messages that will follow the next command...
     
      pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.1-cp27-none-linux_x86_64.whl

      source deactivate

Cascades Usage:

Assume TENSORFLOW has been installed as in the above example.
Suppose that the following simple Python code is to be executed:

      from __future__ import print_function
      import tensorflow as tf
      hello = tf.constant ( 'Hello, TensorFlow!' )
      sess = tf.Session ( )               # Start the tf session
      print ( sess.run ( hello ) )        # Run the session

Then a typical batch job to run the code under TENSORFLOW might be:

    #! /bin/bash
    #PBS -l procs=1,gpus=1
    #PBS -l walltime=00:02:00
    #PBS -q normal_q
    #PBS -A yourallocationnamehere
    #PBS -W group_list=cascades
    #PBS -M youremail@vt.edu
    #PBS -m bea

    cd $PBS_O_WORKDIR

    module purge
    module load Anaconda/2.3.0
    module load cuda/8.0.44 
    module load cudnn/5.1

    source activate tfcascades
    python test.py

NewRiver Installation:

In this example, the user has decided to create a subdirectory
tfnewriver into which to install TENSORFLOW. The user
should log in interactively to NewRiver and issue the following commands:

      module purge
      module load Anaconda/4.2.0
      module load cuda/8.0.44 
      module load cudnn/5.1

      # Type y and hit enter when prompted with "Proceed ([y]/n)?"
      conda create -n tfnewriver anaconda

      source activate tfnewriver

      # ignore the warning message that will follow the next command...

      pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.1-cp36-cp36m-linux_x86_64.whl

      source deactivate

NewRiver Usage:

Assume TENSORFLOW has been installed as in the above example.
Suppose that the following simple Python code is to be executed:

      from __future__ import print_function
      import tensorflow as tf
      hello = tf.constant ( 'Hello, TensorFlow!' )
      sess = tf.Session ( )               # Start the tf session
      print ( sess.run ( hello ) )        # Run the session

Then a typical batch job to run the code under TENSORFLOW might be:

    #! /bin/bash
    #PBS -l procs=1,gpus=1
    #PBS -l walltime=00:02:00
    #PBS -q normal_q
    #PBS -A yourallocationnamehere
    #PBS -W group_list=newriver
    #PBS -M youremail@vt.edu
    #PBS -m bea

    cd $PBS_O_WORKDIR

    module purge
    module load Anaconda/4.2.0
    module load cuda/8.0.44 
    module load cudnn/5.1

    source activate tfnewriver
    python test.py

KERAS

To install Keras, https://keras.io/, over TensorFlow you need to do the following for Newriver (Follow the comments for Cascades).

    module purge
    module load Anaconda/4.2.0 # use Anaconda/2.3.0 on Cascades
    module load cuda/8.0.44 
    module load cudnn/5.1

    source activate tfnewriver  #use tfcascades on Cascades
    pip install --upgrade keras

 

A complete set of files to carry out a similar process are available in
tensorflow_example.tar