Difference between revisions of "Tensorflow"

From GISAXS
Jump to: navigation, search
(Installation instructions)
(Virtualenv method)
Line 15: Line 15:
 
##: apt-get update
 
##: apt-get update
 
##: aptitude install cuda
 
##: aptitude install cuda
 +
# Install CUDA (alternate method, if above doesn't work):
 +
## Download CUDA runfile from [https://developer.nvidia.com/cuda-downloads the nVida site] (CUDA toolkit 7.5 runfile):
 +
##: wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run
 
# Set up environment
 
# Set up environment
 
##: nano ~/.bashrc
 
##: nano ~/.bashrc

Revision as of 13:56, 13 September 2016

TensorFlow is an open source library for deep learning.

Installation instructions

Virtualenv method

Detailed instructions are provided on the TensorFlow website.

  1. Install CUDA
    1. Download CUDA from the nVidia site (CUDA toolkit 7.5):
      wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-ubuntu1504-7-5-local_7.5-18_amd64.deb
    2. Update root path (if necessary):
      sudo nano /root/.bashrc
      export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/conda/bin
    3. Install deb (c.f. instructions here):
      sudo -s
      dpkg -i cuda-repo-ubuntu1504-7-5-local_7.5-18_amd64.deb
      apt-get update
      aptitude install cuda
  2. Install CUDA (alternate method, if above doesn't work):
    1. Download CUDA runfile from the nVida site (CUDA toolkit 7.5 runfile):
      wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run
  3. Set up environment
    1. nano ~/.bashrc
      # Add these lines to the end of your .bashrc file:
      export CUDA_HOME=/usr/local/cuda-7.5
      export LD_LIBRARY_PATH=${CUDA_HOME}/lib64
      PATH=${CUDA_HOME}/bin:${PATH}
      export PATH
  4. Create Virtualenv:
    1. virtualenv --system-site-packages ~/tensorflow
  5. Activate Virtualenv:
    1. source ~/tensorflow/bin/activate
      # Prompt should change to start with "(tensorflow)$"
  6. Install TensorFlow into Virtualenv:
    # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
    # Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl
    (tensorflow)$ pip install --upgrade $TF_BINARY_URL
  7. Test:
    (tensorflow)$ python
    >>> import tensorflow as tf

See Also