A tutorial how to setup a local deep learning enviroment. I tend to forget things, therefore this is a remainder how I like doing it.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md

README.md

Deeplearning Local Environment Setup (GPU)

A tutorial how to setup a local deep learning environment. I tend to forget things, therefore this is a remainder how I like doing it. The general gist is that instead of installing CUDA and playing with local enviroments we will use docker and nvidia-docker which installs CUDA for us making our job pasting one line of code.

Dependencies

Setup

1. Install Dependencies

2. Verify Install

Run this to verify first step (probably need to restart terminal if docker was added to sudo users, heck just restart your whole machine)

docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

3. Create a Deep Learning Container

Create a docker container (the -v maps your local file sytem to docker one /workspace so that you can access those files from inside docker.

  • TensorFlow

    nvidia-docker run -it -p 127.0.0.1:8888:8888 --name=tensorflow --ipc=host -v /path_to_your_project_dir:/workspace gcr.io/tensorflow/tensorflow:latest-gpu-py3
  • PyTorch

    nvidia-docker run -it -p 8888:8888 --name=pytorch --ipc=host -v /path_to_your_project_dir:/workspace pytorch/pytorch:latest

4. Install Libraries

Now that you are inside the shell you can install anything you want. First we need to shell into the container than run install commands.

  • Shell into a docker container
docker exec -it container_name bash
  • General purpose scientific compute libs and utilities
python3 -m pip install --upgrade pip
python3 -m pip install jupyter tqdm keras scipy matplotlib numpy scipy nltk sklearn lightgbm kaggle h5py xgboost gensim spacy requests pandas

5. Docker Container Basics

Basic commands to help you start with docker.

  • Start a container

    docker start container_name
  • Stop a container

    docker start container_name
  • Show images

    docker images
  • Show processes

    docker ps
  • Show all processes

    docker ps -a
  • Delete all stopped containers

    docker container prune

6. Jupyter

To run jupyter notebooks:

jupyter notebook --port=8888 --ip=127.0.0.1 --allow-root

Author

Have any questions, ping me on vinko.kodzoman@yahoo.com