Created
January 24, 2017 07:55
-
-
Save uiur/6e0273eeda444dda6ac8fbafb75d42a6 to your computer and use it in GitHub Desktop.
python3 + caffe
This file contains hidden or 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 python:3.5 | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
wget \ | |
python3-dev \ | |
libatlas-base-dev \ | |
libboost-all-dev \ | |
libgflags-dev \ | |
libgoogle-glog-dev \ | |
libhdf5-serial-dev \ | |
libleveldb-dev \ | |
liblmdb-dev \ | |
libopencv-dev \ | |
libprotobuf-dev \ | |
libsnappy-dev \ | |
protobuf-compiler \ | |
&& rm -rf /var/lib/apt/lists/* | |
ENV CAFFE_ROOT=/opt/caffe | |
WORKDIR $CAFFE_ROOT | |
RUN git clone --depth 1 https://github.com/BVLC/caffe.git . && \ | |
pip install --upgrade pip && \ | |
cd python && for req in $(cat requirements.txt) pydot; do pip install $req; done && cd .. && \ | |
mkdir build && cd build && \ | |
cmake -DCPU_ONLY=1 -Dpython_version=3 .. && \ | |
make -j"$(nproc)" | |
ENV PYCAFFE_ROOT $CAFFE_ROOT/python | |
ENV PYTHONPATH $PYCAFFE_ROOT:$PYTHONPATH | |
ENV PATH $CAFFE_ROOT/build/tools:$PYCAFFE_ROOT:$PATH | |
RUN echo "$CAFFE_ROOT/build/lib" >> /etc/ld.so.conf.d/caffe.conf && ldconfig | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment