SkillAgentSearch skills...

Deepo

Setup and customize deep learning environment in seconds.

Install / Use

/learn @ufoym/Deepo

README

deepo

workflows docker build license

PLEASE NOTE, THE DEEP LEARNING FRAMEWORK WAR IS OVER, THIS PROJECT IS NO LONGER BEING MAINTAINED.


Deepo is an open framework to assemble specialized docker images for deep learning research without pain. It provides a “lego set” of dozens of standard components for preparing deep learning tools and a framework for assembling them into custom docker images.

At the core of Deepo is a Dockerfile generator that

  • allows you to customize your deep learning environment with Lego-like modules
    • define your environment in a single command line,
    • then deepo will generate Dockerfiles with best practices
    • and do all the configuration for you
  • automatically resolves the dependencies for you
    • deepo knows which combos (CUDA/cuDNN/Python/PyTorch/Tensorflow, ..., tons of dependancies) are compatible
    • and will pick the right versions for you
    • and arrange sequence of installation procedures using topological sorting

We also prepare a series of pre-built docker images that


Table of contents


<a name="Quick-Start"/>

Quick Start

<a name="GPU"/>

GPU Version

<a name="Installation"/>

Installation

Step 1. Install Docker and nvidia-docker.

Step 2. Obtain the all-in-one image from Docker Hub

docker pull ufoym/deepo

For users in China who may suffer from slow speeds when pulling the image from the public Docker registry, you can pull deepo images from the China registry mirror by specifying the full path, including the registry, in your docker pull command, for example:

docker pull registry.docker-cn.com/ufoym/deepo
<a name="Usage"/>

Usage

Now you can try this command:

docker run --gpus all --rm ufoym/deepo nvidia-smi

This should work and enables Deepo to use the GPU from inside a docker container. If this does not work, search the issues section on the nvidia-docker GitHub -- many solutions are already documented. To get an interactive shell to a container that will not be automatically deleted after you exit do

docker run --gpus all -it ufoym/deepo bash

If you want to share your data and configurations between the host (your machine or VM) and the container in which you are using Deepo, use the -v option, e.g.

docker run --gpus all -it -v /host/data:/data -v /host/config:/config ufoym/deepo bash

This will make /host/data from the host visible as /data in the container, and /host/config as /config. Such isolation reduces the chances of your containerized experiments overwriting or using wrong data.

Please note that some frameworks (e.g. PyTorch) use shared memory to share data between processes, so if multiprocessing is used the default shared memory segment size that container runs with is not enough, and you should increase shared memory size either with --ipc=host or --shm-size command line options to docker run.

docker run --gpus all -it --ipc=host ufoym/deepo bash
<a name="CPU"/>

CPU Version

<a name="Installation-cpu"/>

Installation

Step 1. Install Docker.

Step 2. Obtain the all-in-one image from Docker Hub

docker pull ufoym/deepo:cpu
<a name="Usage-cpu"/>

Usage

Now you can try this command:

docker run -it ufoym/deepo:cpu bash

If you want to share your data and configurations between the host (your machine or VM) and the container in which you are using Deepo, use the -v option, e.g.

docker run -it -v /host/data:/data -v /host/config:/config ufoym/deepo:cpu bash

This will make /host/data from the host visible as /data in the container, and /host/config as /config. Such isolation reduces the chances of your containerized experiments overwriting or using wrong data.

Please note that some frameworks (e.g. PyTorch) use shared memory to share data between processes, so if multiprocessing is used the default shared memory segment size that container runs with is not enough, and you should increase shared memory size either with --ipc=host or --shm-size command line options to docker run.

docker run -it --ipc=host ufoym/deepo:cpu bash

You are now ready to begin your journey.

$ python

>>> import tensorflow
>>> import sonnet
>>> import torch
>>> import keras
>>> import mxnet
>>> import cntk
>>> import chainer
>>> import theano
>>> import lasagne
>>> import caffe
>>> import paddle

$ caffe --version

caffe version 1.0.0

$ darknet

usage: darknet <function>
<a name="Customization"/>

Customization

Note that docker pull ufoym/deepo mentioned in Quick Start will give you a standard image containing all available deep learning frameworks. You can customize your own environment as well.

<a name="One"/>

Unhappy with all-in-one solution?

If you prefer a specific framework rather than an all-in-one image, just append a tag with the name of the framework. Take tensorflow for example:

docker pull ufoym/deepo:tensorflow
<a name="Jupyter"/>

Jupyter support

Step 1. pull the all-in-one image

docker pull ufoym/deepo

Step 2. run the image

docker run --gpus all -it -p 8888:8888 -v /home/u:/root --ipc=host ufoym/deepo jupyter lab --no-browser --ip=0.0.0.0 --allow-root --LabApp.allow_origin='*' --LabApp.root_dir='/root'
<a name="Build"/>

Build your own customized image with Lego-like modules

Step 1. prepare generator

git clone https://github.com/ufoym/deepo.git
cd deepo/generator

Step 2. generate your customized Dockerfile

For example, if you like pytorch and lasagne, then

python generate.py Dockerfile pytorch lasagne

or with CUDA 11.1 and CUDNN 8

python generate.py Dockerfile pytorch lasagne --cuda-ver 11.1 --cudnn-ver 8

This should generate a Dockerfile that contains everything for building pytorch and lasagne. Note that the generator can handle automatic dependency processing and topologically sort the lists. So you don't need to worry about missing dependencies and the list order.

You can also specify the version of Python:

python generate.py Dockerfile pytorch lasagne python==3.6

Step 3. build your Dockerfile

docker build -t my/deepo .

This may take several minutes as it compiles a few libraries from scratch.

<a name="Comparison"/>

Comparison to alternatives

. | modern-deep-learning | dl-docker | jupyter-deeplearning | Deepo :------------------------------------------------: | :------------------: | :----------------: | :------------------: | :----------------: ubuntu | 16.04 | 14.04 | 14.04 | 18.04 cuda | X | 8.0 | 6.5-8.0 | 8.0-10.2/None cudnn | X | v5 | v2-5 | v7 onnx | X | X | X | O theano | X | O | O | O tensorflow | O | O | O | O sonnet | X | X | X | O pytorch | X | X | X | O keras | O | O | O | O lasagne | X | O | O | O mxnet | X | X | X | O cntk | X | X | X | O chainer | X

View on GitHub
GitHub Stars6.3k
CategoryEducation
Updated2d ago
Forks743

Languages

Python

Security Score

100/100

Audited on Mar 21, 2026

No findings