A Hitchhiker's Guide to Setup a Deep Learning Environment on Mac OS X - achillesrasquinha/Practical-Deep-Learning GitHub Wiki

From Zero to Hero - Achilles Rasquinha

To the best of my knowledge, this will be the only page you'd ever require to setup a Deep Learning environment right from scratch. This script also believes to be a foolproof setup to have a Deep Learning environment setup on your system. In case if you run into some problems, feel free to raise an issue here.

NOTE: To see if your Mac OS X version has been tested, check here. You're free to revise this page in order to add your Mac OS X version if you're successful with this script too (psst, helps others).

Installation

First, open your Terminal (Finder > Go (Menu Bar) > Utilities > Terminal)

  • Install Xcode command-line tools
$ xcode-select --install

When you execute the above command, a pop-up window will appear. Click on Install and then accept the terms and conditions (by clicking on Agree). Once downloaded and installed, click on Done.

Brewing

  • Install Homebrew - Mac OS X's package manager
    (Requires Ruby installed. To our luck, Ruby comes packaged with most Mac OS X systems)

On OS X El Capitan, Yosemite, Mavericks, and macOS Sierra, Ruby 2.0 is included. OS X Mountain Lion, Lion, and Snow Leopard ship with Ruby 1.8.7 - Ruby Lang Documentation

(Type ruby --version to check whether Ruby is available on your system)

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Check whether Homebrew has been installed correctly
$ brew doctor

You should then see - Your system is ready to brew! on your terminal screen

  • Update Homebrew and its formulae
$ brew update

Git

  • Install git (Using Homebrew)
$ brew install git
  • ...and check if git has been correctly installed.
$ git --version

You should then see the version information only.

Fetching the repository via git

  • Clone the repository using git.
$ git clone https://github.com/achillesrasquinha/Practical-Deep-Learning.git

This just goes ahead and pulls the source files from the remote git repository.

  • Ensure you're pointing to the repository's root directory
$ cd Practical-Deep-Learning

Dependency Requirements for both, Development and Production

  • Install Python 3 (Using Homebrew)
    (Comes with pip - Python's Package Manager installed)
$ brew install python3
Installing Python dependencies
Creating a Python Virtual Environment

We recommend you to install the repository's Python Dependencies within a virtualenv (A virtualenv goes ahead and creates an isolated Python environment for you).

  • Install and Create a virtualenv named venv
$ pip3 install virtualenv         # Installs a Python Virtual Environment
$ virtualenv .venv/py3 -p python3 # Creates  a Python Virtual Environment named `py3`
$ source .venv/py3/bin/activate   # Goes ahead and activates the Virtual Environment for you.
  • Now, simply install Python Dependencies
For Production only
(py3) $ pip install -r requirements.txt
For Development only
(py3) $ pip install -r requirements-dev.txt

Tried and Tested

NOTE: If you're attempting to revise this page after successfully installing, kindly add the required details in the following format only.

Name Version By
macOS Sierra 10.12.5 Achilles Rasquinha
@achillesrasquinha, [email protected]
⚠️ **GitHub.com Fallback** ⚠️