From 846dd086a1b6d29cf7612929def43717a423f416 Mon Sep 17 00:00:00 2001 From: sbkim052 <59387731+sbkim052@users.noreply.github.com> Date: Mon, 28 Sep 2020 15:33:59 +0900 Subject: [PATCH 1/2] Update Dockerfile --- docker/Dockerfile | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 762441fe2..acb198038 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,8 @@ ARG CUDA="9.0" ARG CUDNN="7" FROM nvidia/cuda:${CUDA}-cudnn${CUDNN}-devel-ubuntu16.04 - +CMD nvidia-smi +RUN NVIDIA_VISIBLE_DEVICES=0 RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections # install basics @@ -11,18 +12,19 @@ RUN apt-get update -y \ && apt-get install -y libglib2.0-0 libsm6 libxext6 libxrender-dev # 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 - +RUN curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ + && bash Miniconda3-latest-Linux-x86_64.sh -p /miniconda -b \ + && rm Miniconda3-latest-Linux-x86_64.sh +RUN ls ENV PATH=/miniconda/bin:$PATH # Create a Python 3.6 environment RUN /miniconda/bin/conda install -y conda-build \ - && /miniconda/bin/conda create -y --name py36 python=3.6.7 \ + && /miniconda/bin/conda create -y --name py36 python=3.6.8 \ && /miniconda/bin/conda clean -ya +RUN pip install --upgrade pip + ENV CONDA_DEFAULT_ENV=py36 ENV CONDA_PREFIX=/miniconda/envs/$CONDA_DEFAULT_ENV ENV PATH=$CONDA_PREFIX/bin:$PATH @@ -31,26 +33,11 @@ ENV CONDA_AUTO_UPDATE_CONDA=false RUN conda install -y ipython RUN pip install requests ninja yacs cython matplotlib opencv-python tqdm -# Install PyTorch 1.0 Nightly +# Install PyTorch 1.4 ARG CUDA -RUN conda install pytorch-nightly cudatoolkit=${CUDA} -c pytorch \ +RUN conda install pytorch==1.4 torchvision==0.5.0 cudatoolkit=${CUDA} -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 apex -RUN git clone https://github.com/NVIDIA/apex.git \ - && cd apex \ - && python setup.py install --cuda_ext --cpp_ext - # install PyTorch Detection ARG FORCE_CUDA="1" ENV FORCE_CUDA=${FORCE_CUDA} From 9cda5a43972415f2de77facaa056e84d0aa0f70f Mon Sep 17 00:00:00 2001 From: sbkim052 <59387731+sbkim052@users.noreply.github.com> Date: Mon, 28 Sep 2020 15:36:54 +0900 Subject: [PATCH 2/2] Update INSTALL.md --- INSTALL.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index eaa38af26..126f960cf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -121,6 +121,11 @@ cd maskrcnn-benchmark python setup.py build develop ``` ### Option 2: Docker Image (Requires CUDA, Linux only) +Install nvidia-docker + +Edit daemon.json file (refer to below link) + + https://stackoverflow.com/questions/59691207/docker-build-with-nvidia-runtime Build image with defaults (`CUDA=9.0`, `CUDNN=7`, `FORCE_CUDA=1`):