deepo

ufoymMIT更新放缓

一条命令就能搭好包含 Caffe、Keras、MXNet 等主流框架的深度学习 Docker 环境,省去逐个配置依赖的麻烦。

Setup and customize deep learning environment in seconds.

v2.0.0发布于 2017-11-27 15:04 UTC6,282star +1 / 7 天729fork同步于 2026-11-10 17:35 UTC

怎么上手

由 README 提炼,执行前请确认
docker pull ufoym/deepo
docker run --gpus all --rm ufoym/deepo nvidia-smi
硬件要求按 README 说明

GPU 版需 NVIDIA 显卡并安装 NVIDIA Container Toolkit,镜像内含 CUDA 11.3 与 cuDNN 8;CPU 版可在 Linux、Windows、macOS 上运行。README 未说明具体显存要求。

纯 CPU 可运行需要 CUDA有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用乐高式模块组合出深度学习 Docker 镜像,自动解决框架与 CUDA 版本依赖

一条命令就能搭好包含 Caffe、Keras、MXNet 等主流框架的深度学习 Docker 环境,省去逐个配置依赖的麻烦。

核心能力

  • 用命令行指定框架模块生成定制 Dockerfile
  • 自动解析 CUDA、cuDNN、Python 与框架的版本兼容性
  • 用拓扑排序确定组件的正确安装顺序
  • 提供含 TensorFlow、PyTorch、Keras 等框架的预构建镜像
  • 支持 GPU 加速与纯 CPU 两种运行模式

容易踩的坑

GPU 版必须先装好 NVIDIA Container Toolkit,否则容器内无法访问显卡;PyTorch 等多进程场景默认共享内存不足,需加 --ipc=host 或 --shm-size;自行构建镜像时部分库从源码编译,耗时数分钟。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

2 个版本v2.0.0
  1. v2.0.0Deepo v2.0.0最新正式版2017-11-27 · 2017-11-27 15:04 UTC

    Deepo2 is now a series of Docker images that

    and their Dockerfile generator that

    • allows you to customize your own environment with Lego-like modules
    • automatically resolves the dependencies for you

    Table of contents


    Quick Start

    Installation

    Step 1. Install Docker and nvidia-docker.
    Step 2. Obtain the all-in-one image from Docker Hub
    docker pull ufoym/deepo
    

    Usage

    Now you can try this command:

    nvidia-docker run --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

    nvidia-docker run -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.

    nvidia-docker run -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 nvidia-docker run.

    nvidia-docker run -it --ipc=host ufoym/deepo 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
    

    $ caffe --version

    caffe version 1.0.0
    

    $ th

     │  ______             __   |  Torch7
     │ /_  __/__  ________/ /   |  Scientific computing for Lua.
     │  / / / _ \/ __/ __/ _ \  |  Type ? for help
     │ /_/  \___/_/  \__/_//_/  |  https://github.com/torch
     │                          |  http://torch.ch
     │
     │th>
    

    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.

    I hate all-in-one solution

    If you prefer a specific framework rather than an all-in-one image, ju

  2. v1.0.0Deepo v1.0.02017-11-27 · 2017-11-27 14:53 UTC
    查看更新说明

    Deepo is a Docker image with a full reproducible deep learning research environment. It contains most popular deep learning frameworks: theano, tensorflow, sonnet, pytorch, keras, lasagne, mxnet, cntk, chainer, caffe, torch.


    Quick Start

    Installation

    Step 1. Install Docker and nvidia-docker.
    Step 2. Obtain the Deepo image

    You can either directly download the image from Docker Hub, or build the image yourself.

    Option 1: Get the image from Docker Hub (recommended)
    docker pull ufoym/deepo
    
    Option 2: Build the Docker image locally
    git clone https://github.com/ufoym/deepo.git
    cd deepo && docker build -t ufoym/deepo .
    

    Note that this may take several hours as it compiles a few libraries from scratch.

    Usage

    Now you can try this command:

    nvidia-docker run --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

    nvidia-docker run -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.

    nvidia-docker run -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.

    You are now ready to begin your journey.

    tensorflow

    $ python

    >>> import tensorflow
    >>> print(tensorflow.__name__, tensorflow.__version__)
    tensorflow 1.3.0
    

    sonnet

    $ python

    >>> import sonnet
    >>> print(sonnet.__name__, sonnet.__path__)
    sonnet ['/usr/local/lib/python3.5/dist-packages/sonnet']
    
    pytorch

    $ python

    >>> import torch
    >>> print(torch.__name__, torch.__version__)
    torch 0.2.0_3
    

    keras

    $ python

    >>> import keras
    >>> print(keras.__name__, keras.__version__)
    keras 2.0.8
    
    mxnet

    $ python

    >>> import mxnet
    >>> print(mxnet.__name__, mxnet.__version__)
    mxnet 0.11.0
    

    cntk

    $ python

    >>> import cntk
    >>> print(cntk.__name__, cntk.__version__)
    cntk 2.2
    
    chainer

    $ python

    >>> import chainer
    >>> print(chainer.__name__, chainer.__version__)
    chainer 3.0.0
    

    theano

    $ python

    >>> import theano
    >>> print(theano.__name__, theano.__version__)
    theano 0.10.0beta4+14.gb6e3768
    
    lasagne

    $ python

    >>> import lasagne
    >>> print(lasagne.__name__, lasagne.__version__)
    lasagne 0.2.dev1
    

    caffe

    $ python

    >>> import caffe
    >>> print(caffe.__name__, caffe.__version__)
    caffe 1.0.0
    

    $ caffe --version

    caffe version 1.0.0
    

    torch

    $ th

     │  ______       
    

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    deepo

    workflows docker license


    Deepo is an open framework for painlessly assembling specialized Docker images for deep learning research. It provides a "Lego set" of dozens of standard components for preparing deep learning tools, along with a framework for composing them into custom Docker images.

    At the core of Deepo is a Dockerfile generator that

    • lets you customize your deep learning environment with Lego-like modules
      • describe your environment in a single command line
      • Deepo generates Dockerfiles following best practices
      • and handles all the configuration for you
    • automatically resolves dependencies
      • Deepo knows which combinations of CUDA, cuDNN, Python, PyTorch, TensorFlow, etc. are compatible
      • picks the right versions on your behalf
      • and determines the correct installation order via topological sorting

    We also provide a series of pre-built Docker images that


    Table of contents


    Quick Start

    GPU Version

    Installation

    Step 1. Install Docker and NVIDIA Container Toolkit.
    Step 2. Pull the all-in-one image from Docker Hub
    docker pull ufoym/deepo
    

    Usage

    Verify that GPU access works inside a container:

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

    If this does not work, check the issues section of the NVIDIA Container Toolkit GitHub — many solutions are already documented. To launch an interactive shell in a persistent container:

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

    To share data and configuration between the host (your machine or VM) and the container, use the -v option:

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

    This makes /host/data on the host visible as /data inside the container, and /host/config as /config. This isolation helps prevent containerized experiments from accidentally overwriting or reading the wrong data.

    Note that some frameworks (e.g., PyTorch) use shared memory for inter-process communication. If you use multiprocessing, the container's default shared memory size may be insufficient. Increase it with --ipc=host or --shm-size:

    docker run --gpus all -it --ipc=host ufoym/deepo bash
    

    CPU Version

    Installation

    Step 1. Install Docker.
    Step 2. Pull the all-in-one image from Docker Hub
    docker pull ufoym/deepo:cpu
    

    Usage

    Launch an interactive shell:

    docker run -it ufoym/deepo:cpu bash
    

    To share data and configuration between the host (your machine or VM) and the container, use the -v option:

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

    This makes /host/data on the host visible as /data inside the container, and /host/config as /config. This isolation helps prevent containerized experiments from accidentally overwriting or reading the wrong data.

    Note that some frameworks (e.g., PyTorch) use shared memory for inter-process communication. If you use multiprocessing, the container's default shared memory size may be insufficient. Increase it with --ipc=host or --shm-size:

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

    You are now ready to begin your journey.

    $ python
    
    >>> import tensorflow
    >>> import torch
    >>> import keras
    >>> import mxnet
    >>> import chainer
    >>> import paddle
    
    $ darknet
    
    usage: darknet <function>
    

    Customization

    The docker pull ufoym/deepo command from Quick Start gives you a standard image containing every available deep learning framework. You can also customize your own environment.

    Unhappy with all-in-one solution?

    If you prefer a single framework instead of the all-in-one image, simply append a tag with the framework name. For example, to pull TensorFlow only:

    docker pull ufoym/deepo:tensorflow
    

    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'
    

    Build Your Own Customized Image with Lego-like Modules

    Step 1. Set up the generator
    git clone https://github.com/ufoym/deepo.git
    cd deepo/generator
    
    Step 2. Generate a customized Dockerfile

    For example, to create an image with pytorch and keras:

    python generate.py Dockerfile pytorch keras
    

    Or with CUDA 11.3 and cuDNN 8:

    python generate.py Dockerfile pytorch keras --cuda-ver 11.3.1 --cudnn-ver 8
    

    This generates a Dockerfile with everything needed to build pytorch and keras. The generator automatically resolves dependencies and topologically sorts them, so you don't need to worry about missing packages or ordering.

    You can also specify the Python version:

    python generate.py Dockerfile pytorch keras python==3.8
    
    Step 3. Build the Dockerfile
    docker build -t my/deepo .
    

    This may take several minutes, as some libraries are compiled from source.

    Comparison to Alternatives

    .modern-deep-learningdl-dockerjupyter-deeplearningDeepo
    ubuntu16.0414.0414.0420.04
    cudaX8.06.5-8.011.3/None
    cudnnXv5v2-5v8
    onnxXXXO
    tensorflowOOOO
    pytorchXXXO
    kerasOOOO
    mxnetXXXO
    chainerXXXO
    darknetXXXO
    paddlepaddleXXXO

    Tags

    Available Tags

    .CUDA 11.3 / Python 3.8CPU-only / Python 3.8
    all-in-onelatest all all-py38 py38-cu113 all-py38-cu113all-py38-cpu all-cpu py38-cpu cpu
    TensorFlowtensorflow-py38-cu113 tensorflow-py38 tensorflowtensorflow-py38-cpu tensorflow-cpu
    PyTorchpytorch-py38-cu113 pytorch-py38 pytorchpytorch-py38-cpu pytorch-cpu
    Keraskeras-py38-cu113 keras-py38 keraskeras-py38-cpu keras-cpu
    MXNetmxnet-py38-cu113 mxnet-py38 mxnetmxnet-py38-cpu mxnet-cpu
    Chainerchainer-py38-cu113 chainer-py38 chainerchainer-py38-cpu chainer-cpu
    Darknetdarknet-cu113 darknetdarknet-cpu
    PaddlePaddlepaddle-cu113 paddlepaddle-cpu

    Deprecated Tags

    .CUDA 11.3 / Python 3.6CUDA 11.1 / Python 3.6CUDA 10.1 / Python 3.6CUDA 10.0 / Python 3.6CUDA 9.0 / Python 3.6CUDA 9.0 / Python 2.7CPU-only / Python 3.6CPU-only / Python 2.7
    all-in-onepy36-cu113 all-py36-cu113py36-cu111 all-py36-cu111py36-cu101 all-py36-cu101py36-cu100 all-py36-cu100py36-cu90 all-py36-cu90all-py27-cu90 all-py27 py27-cu90all-py27-cpu py27-cpu
    all-in-one with jupyterall-jupyter-py36-cu90all-py27-jupyter py27-jupyterall-py27-jupyter-cpu py27-jupyter-cpu
    Theanotheano-py36-cu113theano-py36-cu111theano-py36-cu101theano-py36-cu100theano-py36-cu90theano-py27-cu90 theano-py27theano-py27-cpu
    TensorFlowtensorflow-py36-cu113tensorflow-py36-cu111tensorflow-py36-cu101tensorflow-py36-cu100tensorflow-py36-cu90tensorflow-py27-cu90 tensorflow-py27tensorflow-py27-cpu
    Sonnetsonnet-py36-cu113sonnet-py36-cu111sonnet-py36-cu101sonnet-py36-cu100sonnet-py36-cu90sonnet-py27-cu90 sonnet-py27sonnet-py27-cpu
    PyTorchpytorch-py36-cu113pytorch-py36-cu111pytorch-py36-cu101pytorch-py36-cu100pytorch-py36-cu90pytorch-py27-cu90 pytorch-py27pytorch-py27-cpu
    Keraskeras-py36-cu113keras-py36-cu111keras-py36-cu101keras-py36-cu100keras-py36-cu90keras-py27-cu90 keras-py27keras-py27-cpu
    Lasagnelasagne-py36-cu113lasagne-py36-cu111lasagne-py36-cu101lasagne-py36-cu100lasagne-py36-cu90lasagne-py27-cu90 lasagne-py27lasagne-py27-cpu
    MXNetmxnet-py36-cu113mxnet-py36-cu111mxnet-py36-cu101mxnet-py36-cu100mxnet-py36-cu90mxnet-py27-cu90 mxnet-py27mxnet-py27-cpu
    CNTKcntk-py36-cu113cntk-py36-cu111cntk-py36-cu101cntk-py36-cu100cntk-py36-cu90cntk-py27-cu90 cntk-py27cntk-py27-cpu
    Chainerchainer-py36-cu113chainer-py36-cu111chainer-py36-cu101chainer-py36-cu100chainer-py36-cu90chainer-py27-cu90 chainer-py27chainer-py27-cpu
    Caffecaffe-py36-cu113caffe-py36-cu111caffe-py36-cu101caffe-py36-cu100caffe-py36-cu90caffe-py27-cu90 caffe-py27caffe-py27-cpu
    Caffe2caffe2-py36-cu90 caffe2-py36 caffe2caffe2-py27-cu90 caffe2-py27caffe2-py36-cpu caffe2-cpucaffe2-py27-cpu
    Torchtorch-cu113torch-cu111torch-cu101torch-cu100torch-cu90torch-cu90 torchtorch-cpu
    Darknetdarknet-cu113darknet-cu111darknet-cu101darknet-cu100darknet-cu90darknet-cu90 darknetdarknet-cpu

    Citation

    @misc{ming2017deepo,
        author = {Ming Yang},
        title = {Deepo: Set up a deep learning environment with a single command line.},
        year = {2017},
        publisher = {GitHub},
        journal = {GitHub repository},
        howpublished = {\url{https://github.com/ufoym/deepo}}
    }
    

    Contributing

    We appreciate all contributions. If you are planning to contribute bug fixes, please go ahead and open a pull request directly. If you plan to contribute new features, utility functions, or extensions, please open an issue first to discuss your idea with us.

    Licensing

    Deepo is MIT licensed.