一。搭建环境三步走:
1. 第一步构建dockerfile文件
detectron.Dockerfile
# Use Caffe2 image as parent image
FROM caffe2/caffe2:snapshot-py2-cuda9.0-cudnn7-ubuntu16.04
RUN mv /usr/local/caffe2 /usr/local/caffe2_build
ENV Caffe2_DIR /usr/local/caffe2_build
ENV PYTHONPATH /usr/local/caffe2_build:${PYTHONPATH}
ENV LD_LIBRARY_PATH /usr/local/caffe2_build/lib:${LD_LIBRARY_PATH}
# Clone the Detectron repository
RUN git clone https://github.com/facebookresearch/detectron /detectron
# Install Python dependencies
RUN pip install -r /detectron/requirements.txt
# Install the COCO API
RUN git clone https://github.com/cocodataset/cocoapi.git /cocoapi
WORKDIR /cocoapi/PythonAPI
RUN make install
# Go to Detectron root
WORKDIR /detectron
# Set up Python modules
RUN make
2. build镜像
编译 docker build -t detectron -f detectron.Dockerfile
3. 运行容器
运行 nvidia-docker run -it --name detectron detectron /bin/bash
二。