Commit 1276d20b authored by Miguel Varela Ramos's avatar Miguel Varela Ramos Committed by Francisco Massa

adds Dockerfile (#78)

* added Dockerfile

* intructions for installation with docker

* adds nccl to dockerfile

* Update Dockerfile

* Update INSTALL.md
parent e7edc294
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- (optional) OpenCV for the webcam demo - (optional) OpenCV for the webcam demo
### Step-by-step installation ### Option 1: Step-by-step installation
```bash ```bash
# first, make sure that your conda is setup properly with the right environment # first, make sure that your conda is setup properly with the right environment
...@@ -55,3 +55,13 @@ python setup.py build develop ...@@ -55,3 +55,13 @@ python setup.py build develop
# or if you are on macOS # or if you are on macOS
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py build develop # MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py build develop
``` ```
### Option 2: Docker Image (Requires CUDA, Linux Only)
Build image with defaults (`CUDA_VERSION=9.0`, `CUDNN_VERSION=7`):
nvidia-docker build -t maskrcnn-benchmark docker/
Build image with other CUDA and CUDNN versions:
nvidia-docker build -t --build-arg CUDA_VERSION=9.2 --build-arg CUDNN_VERSION=7 maskrcnn-benchmark docker/
ARG CUDA_VERSION=9.0
ARG CUDNN_VERSION=7
FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu16.04
# install basics
RUN apt-get update -y \
&& apt-get install -y git curl ca-certificates bzip2 cmake tree htop bmon iotop g++ \
&& apt-get install -y --no-install-recommends libnccl2=2.3.5-2+cuda${CUDA_VERSION}
# Install Miniconda
RUN curl -so /miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& chmod +x /miniconda.sh \
&& /miniconda.sh -b -p /miniconda \
&& rm /miniconda.sh
ENV PATH=/miniconda/bin:$PATH
# Create a Python 3.6 environment
RUN /miniconda/bin/conda install conda-build \
&& /miniconda/bin/conda create -y --name py36 python=3.6.7 \
&& /miniconda/bin/conda clean -ya
ENV CONDA_DEFAULT_ENV=py36
ENV CONDA_PREFIX=/miniconda/envs/$CONDA_DEFAULT_ENV
ENV PATH=$CONDA_PREFIX/bin:$PATH
ENV CONDA_AUTO_UPDATE_CONDA=false
RUN conda install ipython
RUN pip install ninja yacs cython matplotlib
# Install PyTorch 1.0 Nightly
RUN conda install pytorch-nightly -c pytorch && conda clean -ya
# Install TorchVision master
RUN git clone https://github.com/pytorch/vision.git \
&& cd vision \
&& python setup.py install
# install pycocotools
RUN git clone https://github.com/cocodataset/cocoapi.git \
&& cd cocoapi/PythonAPI \
&& python setup.py build_ext install
# install PyTorch Detection
RUN git clone https://github.com/facebookresearch/maskrcnn-benchmark.git \
&& cd maskrcnn-benchmark \
&& python setup.py build develop
WORKDIR /maskrcnn-benchmark
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment