TensorFlow: Difference between revisions

From CCN Wiki
Jump to navigation Jump to search
Line 4: Line 4:
You can find information for installing TensorFlow here: https://www.tensorflow.org/install/
You can find information for installing TensorFlow here: https://www.tensorflow.org/install/


The Linux (Ubuntu) install is pretty straight forward as described in the link. However, the Windows installation can be a little tricky. In short, if you want to utilize GPU multithreading (assuming you have a compatible GPU) you'll need to install NVIDIA CUDA 8.0 libraries, and cuDNN version 6.0 (incorrectly called 6.1 in the above link). CUDA 8.0 will first require the installation of Visual Studio 2015 (this can be found for free, but you need to make an account). You'll also need Python 3 (3.5 or 3.6), of which there are multiple install options. If you already have an older version of Python and you don't want to risk collisions, you may want to install via Anaconda. Anaconda creates a virtual environment for Python to operate, and comes with the Spyder IDE, which is very similar to Matlab. However, you would be limited to operating within this environment. You'll want to make sure CUDA 8.0, cuDNN 6.0 (if you haven't dropped these files into the corresponding CUDA DIRs), and your Python scripts are in your path (%path% for Windows).  Now you can install TensorFlow with pip (or Conda, if using Anaconda). The command may vary for doing so depending on your set-up (e.g. py -m pip install tensorflow-gpu OR python -m pip install tensorflow-gpu). If you decided to do a 'native' pip install of Python 3, you'll also want an IDE. You could just use Notepad, but it's not 1980 and there are way better and more efficient development tools. Rodeo (developed by yhat) is a good choice, it operates very much like R studio and Matlab (so it should be somewhat familiar if coming from those).  Another option is Atom (with the hydrogen package), it's got some interesting tricks, but seems less useful for large data sets.
The Linux (Ubuntu) install is pretty straight forward as described in the link. However, the Windows installation can be a little tricky. In short, if you want to utilize GPU multithreading (assuming you have a compatible GPU) you'll need to install NVIDIA CUDA 8.0 libraries, and cuDNN version 6.0 (incorrectly called 6.1 in the above link). CUDA 8.0 will first require the installation of Visual Studio 2015 (this can be found for free, but you need to make an account). You'll also need Python 3 (3.5 or 3.6), of which there are multiple install options. If you already have an older version of Python and you don't want to risk collisions, you may want to install via Anaconda. Anaconda creates a virtual environment for Python to operate, and comes with the Spyder IDE, which is very similar to Matlab. However, you would be limited to operating within this environment. You'll want to make sure CUDA 8.0, cuDNN 6.0 (if you haven't dropped these files into the corresponding CUDA DIRs), and your Python scripts are in your path (%path% for Windows).  Now you can install TensorFlow with pip (or Conda, if using Anaconda). The command may vary for doing so depending on your set-up (e.g. py -m pip install tensorflow-gpu OR python -m pip install tensorflow-gpu). If you decided to do a 'native' pip install of Python 3, you'll also want to find an IDE. You could just use Notepad, but it's not 1980 and there are way better and more efficient development tools. Rodeo (developed by yhat) is a good choice, it operates very much like R studio and Matlab (so it should be somewhat familiar if coming from those).  Another option is Atom (with the hydrogen package), it's got some interesting tricks, but seems less useful for large data sets.


If you don't care about taking advantage of GPU acceleration, or have a dedicated machine for doing so, you can just skip ahead and install Python 3.
If you don't care about taking advantage of GPU acceleration, or have a dedicated machine for doing so, you can just skip ahead and install Python 3.

Revision as of 23:13, 4 December 2017

TensorFlow is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them. The flexible architecture allows you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API. TensorFlow was originally developed by researchers and engineers working on the Google Brain Team within Google's Machine Intelligence research organization for the purposes of conducting machine learning and deep neural networks research, but the system is general enough to be applicable in a wide variety of other domains as well.

Installation (Windows)

You can find information for installing TensorFlow here: https://www.tensorflow.org/install/

The Linux (Ubuntu) install is pretty straight forward as described in the link. However, the Windows installation can be a little tricky. In short, if you want to utilize GPU multithreading (assuming you have a compatible GPU) you'll need to install NVIDIA CUDA 8.0 libraries, and cuDNN version 6.0 (incorrectly called 6.1 in the above link). CUDA 8.0 will first require the installation of Visual Studio 2015 (this can be found for free, but you need to make an account). You'll also need Python 3 (3.5 or 3.6), of which there are multiple install options. If you already have an older version of Python and you don't want to risk collisions, you may want to install via Anaconda. Anaconda creates a virtual environment for Python to operate, and comes with the Spyder IDE, which is very similar to Matlab. However, you would be limited to operating within this environment. You'll want to make sure CUDA 8.0, cuDNN 6.0 (if you haven't dropped these files into the corresponding CUDA DIRs), and your Python scripts are in your path (%path% for Windows). Now you can install TensorFlow with pip (or Conda, if using Anaconda). The command may vary for doing so depending on your set-up (e.g. py -m pip install tensorflow-gpu OR python -m pip install tensorflow-gpu). If you decided to do a 'native' pip install of Python 3, you'll also want to find an IDE. You could just use Notepad, but it's not 1980 and there are way better and more efficient development tools. Rodeo (developed by yhat) is a good choice, it operates very much like R studio and Matlab (so it should be somewhat familiar if coming from those). Another option is Atom (with the hydrogen package), it's got some interesting tricks, but seems less useful for large data sets.

If you don't care about taking advantage of GPU acceleration, or have a dedicated machine for doing so, you can just skip ahead and install Python 3.

Using TensorFlow

In Progress...

https://www.tensorflow.org/get_started/