|
| 1 | +ARG CUDA="10.0" |
| 2 | +ARG CUDNN="7" |
| 3 | + |
| 4 | +FROM nvidia/cuda:${CUDA}-cudnn${CUDNN}-devel-ubuntu16.04 |
| 5 | + |
| 6 | +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections |
| 7 | + |
| 8 | +# install basics |
| 9 | +RUN apt-get update -y \ |
| 10 | + && apt-get install -y apt-utils git curl ca-certificates bzip2 cmake tree htop bmon iotop g++ \ |
| 11 | + && apt-get install -y libglib2.0-0 libsm6 libxext6 libxrender-dev |
| 12 | + |
| 13 | +# Install Miniconda |
| 14 | +RUN curl -so /miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ |
| 15 | + && chmod +x /miniconda.sh \ |
| 16 | + && /miniconda.sh -b -p /miniconda \ |
| 17 | + && rm /miniconda.sh |
| 18 | + |
| 19 | +ENV PATH=/miniconda/bin:$PATH |
| 20 | + |
| 21 | +# Create a Python 3.6 environment |
| 22 | +RUN /miniconda/bin/conda install -y conda-build \ |
| 23 | + && /miniconda/bin/conda create -y --name py36 python=3.6.7 \ |
| 24 | + && /miniconda/bin/conda clean -ya |
| 25 | + |
| 26 | +ENV CONDA_DEFAULT_ENV=py36 |
| 27 | +ENV CONDA_PREFIX=/miniconda/envs/$CONDA_DEFAULT_ENV |
| 28 | +ENV PATH=$CONDA_PREFIX/bin:$PATH |
| 29 | +ENV CONDA_AUTO_UPDATE_CONDA=false |
| 30 | + |
| 31 | +RUN conda install -y ipython |
| 32 | +RUN pip install requests ninja yacs cython matplotlib opencv-python tqdm |
| 33 | + |
| 34 | +# Install PyTorch |
| 35 | +ARG CUDA |
| 36 | +RUN conda install pytorch=1.2 torchvision cudatoolkit=${CUDA} -c pytorch \ |
| 37 | + && conda clean -ya |
| 38 | + |
| 39 | +# install pycocotools |
| 40 | +RUN git clone https://github.com/cocodataset/cocoapi.git \ |
| 41 | + && cd cocoapi/PythonAPI \ |
| 42 | + && python setup.py build_ext install |
| 43 | + |
| 44 | +# install apex |
| 45 | +RUN git clone https://github.com/NVIDIA/apex.git \ |
| 46 | + && cd apex \ |
| 47 | + && python setup.py install --cuda_ext --cpp_ext |
| 48 | + |
| 49 | +RUN apt-get install -y vim |
| 50 | + |
| 51 | +# install PyTorch Detection |
| 52 | +ARG FORCE_CUDA="1" |
| 53 | +ENV FORCE_CUDA=${FORCE_CUDA} |
| 54 | +RUN git clone https://github.com/facebookresearch/maskrcnn-benchmark.git /maskrcnn-benchmark |
| 55 | +WORKDIR /maskrcnn-benchmark |
| 56 | +COPY ./maskrcnn_benchmark/engine/trainer.py maskrcnn_benchmark/engine/ |
| 57 | +COPY ./maskrcnn_benchmark/modeling/matcher.py maskrcnn_benchmark/modeling/ |
| 58 | +COPY ./maskrcnn_benchmark/modeling/roi_heads/box_head/loss.py maskrcnn_benchmark/modeling/roi_heads/box_head/ |
| 59 | +COPY ./maskrcnn_benchmark/modeling/rpn/loss.py maskrcnn_benchmark/modeling/rpn/ |
| 60 | +COPY ./maskrcnn_benchmark/config/defaults.py maskrcnn_benchmark/config/ |
| 61 | +COPY ./maskrcnn_benchmark/data/transforms/__init__.py maskrcnn_benchmark/data/transforms/ |
| 62 | +COPY ./maskrcnn_benchmark/data/transforms/build.py maskrcnn_benchmark/data/transforms/ |
| 63 | +COPY ./maskrcnn_benchmark/data/transforms/transforms.py maskrcnn_benchmark/data/transforms/ |
| 64 | +COPY ./maskrcnn_benchmark/engine/trainer.py maskrcnn_benchmark/engine/ |
| 65 | +COPY ./maskrcnn_benchmark/engine/bbox_aug.py maskrcnn_benchmark/engine/ |
| 66 | +COPY ./maskrcnn_benchmark/config/paths_catalog.py maskrcnn_benchmark/config/ |
| 67 | +COPY ./maskrcnn_benchmark/data/datasets/__init__.py maskrcnn_benchmark/data/datasets/ |
| 68 | +COPY ./maskrcnn_benchmark/data/datasets/kuzushiji.py maskrcnn_benchmark/data/datasets/ |
| 69 | +COPY ./maskrcnn_benchmark/data/datasets/evaluation/__init__.py maskrcnn_benchmark/data/datasets/evaluation/ |
| 70 | +COPY ./maskrcnn_benchmark/data/datasets/evaluation/kuzushiji/__init__.py maskrcnn_benchmark/data/datasets/evaluation/kuzushiji/ |
| 71 | +COPY ./maskrcnn_benchmark/data/datasets/evaluation/kuzushiji/kuzushiji_eval.py maskrcnn_benchmark/data/datasets/evaluation/kuzushiji/ |
| 72 | + |
| 73 | +RUN cd /maskrcnn-benchmark \ |
| 74 | + && python setup.py build develop |
| 75 | +RUN pip install pandas |
| 76 | + |
| 77 | +COPY ./requirements.txt . |
| 78 | +RUN pip install -r requirements.txt |
| 79 | + |
| 80 | +WORKDIR /work |
0 commit comments