In this tutorial, we’ll guide you through the essential steps of building a TensorFlow and a PyTorch working enrivonment on your local machine. For the course we'll be using TensorFlow, but PyTorch is also a very popular framework that you might encounter in the future.

System requirements


Installation Guide

Note: The process is time-consuming/complex for starters, so please prepare an external power supply if necessary. For reference, an official instruction is here:

Step 1: Anaconda Installation

Anaconda is the most popular Python data science platform. It provides a Python package manager that lets you install, update and remove packages.

Useful link for further information about Anaconda:

Step 2: Create Anaconda virtual environment

We are going to create a virtual environment on this Anaconda platform, and install necessary modules. A virtual environment is a named, isolated, working copy of Python that maintains its own files, directories and paths so that you can work with specific versions of libraries or Python itself without affecting other Python projects. Virtual environments make it easy to cleanly separate different projects and avoid problems with different dependencies and version requirements across components. The conda command is the preferred interface for managing installations and virtual environments with the Anaconda Python distribution. (getting strated with conda.)

Step 3: Install CUDA and GPU drivers

Compute Unified Device Architecture (CUDA) is a parallel computing platform and programming model created by NVIDIA. It harnesses the full power of graphics processing units (GPUs) for deep learning purposes.

Step 4: Install cuDNN

cuDNN is a GPU-accelerated library for deep learning.

Note 1: This step requires you to create an NVIDIA account.

Note 2: For this step, if you're familiar with PATH environment variable setup, you can follow the official instructions provided after you login with your account. The following is a more understandable way.

Note 3: If this step goes wrong, you can still install the rest, but when you initiate TensorFlow you will probably see a message: Couldn't open CUDA library The computation speed might be compromised.

Step 5: Install TensorFlow

TensorFlow is an open source deep learning framework created and maintained by Google Brain Team. It is the most popular deep learning framework nowadays.

Note:There are newer versions of Tensorflow released, you can install them following official guide, but we suggest you use the same version as your gcp instance.

For windows users:

For Ubuntu users:

For macOS users:

Note: Always try to activate your virtual environment.

Step 6: Install PyTorch (optional)

PyTorch is another open source machine learning framework for Python, based on Torch. It is developed by Facebook's artificial-intelligence research group. Compared to TensorFlow, PyTorch has its own advantages such as dynamic network design.

To install PyTorch, go to the official website and follow the install instructions.

ECBM E4040 Neural Networks and Deep Learning, 2017.

Columbia University