Created
August 20, 2018 17:24
-
-
Save cewee/356b941a4006a502a67f68213f1a76b5 to your computer and use it in GitHub Desktop.
Docker py-faster-rcnn and caffe with cuda8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04 | |
ENV PACKAGES_ROOT=/opt | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
git \ | |
wget \ | |
libatlas-base-dev \ | |
libboost-all-dev \ | |
libgflags-dev \ | |
libgoogle-glog-dev \ | |
libhdf5-serial-dev \ | |
libleveldb-dev \ | |
liblmdb-dev \ | |
libopencv-dev \ | |
libprotobuf-dev \ | |
python-protobuf \ | |
libsnappy-dev \ | |
protobuf-compiler \ | |
python-dev \ | |
python-numpy \ | |
python-pip \ | |
python-setuptools \ | |
python-scipy \ | |
gfortran \ | |
python-opencv \ | |
cython \ | |
python-skimage \ | |
python-yaml && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN pip install --upgrade pip==9.0 | |
RUN pip install easydict matplotlib | |
WORKDIR $PACKAGES_ROOT | |
RUN git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git && \ | |
cd $PACKAGES_ROOT/py-faster-rcnn && \ | |
git checkout 96dc9f1d | |
WORKDIR $PACKAGES_ROOT/py-faster-rcnn/lib | |
RUN sed -i 's/sm_35/sm_30/g' setup.py && \ | |
rm -f utils/bbox.c nms/cpu_nms.c nms/gpu_nms.cpp && \ | |
make | |
WORKDIR $PACKAGES_ROOT/py-faster-rcnn/caffe-fast-rcnn | |
RUN git remote add acmiyaguchi https://github.com/acmiyaguchi/caffe-fast-rcnn.git | |
RUN git fetch acmiyaguchi | |
RUN git checkout acmiyaguchi/faster-rcnn-rebased | |
RUN cp Makefile.config.example Makefile.config && \ | |
echo "USE_CUDNN := 1" >> Makefile.config && \ | |
echo 'INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/cuda/include /usr/include/hdf5/serial/' >> Makefile.config && \ | |
echo 'LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/' >> Makefile.config && \ | |
echo 'WITH_PYTHON_LAYER := 1' >> Makefile.config && \ | |
echo 'LIBRARIES += hdf5_serial_hl hdf5_serial' >> Makefile.config && \ | |
sed -i '/compute_35/d' Makefile.config && \ | |
cat Makefile.config && \ | |
make -j8 && make pycaffe -j8 | |
RUN sed -i 's/self.param_str_/self.param_str/g' /opt/py-faster-rcnn/lib/rpn/proposal_layer.py | |
WORKDIR $PACKAGES_ROOT/py-faster-rcnn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment