Skip to content

Instantly share code, notes, and snippets.

@crcrpar
Created January 28, 2018 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crcrpar/d398631be7d0c1e92aabad6b8a8453dc to your computer and use it in GitHub Desktop.
Save crcrpar/d398631be7d0c1e92aabad6b8a8453dc to your computer and use it in GitHub Desktop.
dockerfile to try pytorch to caffe2
FROM caffe2ai/caffe2:c2v0.8.1.cpu.min.ubuntu16.04
LABEL maintainer="aaronmarkham@fb.com"
# caffe2 install with cpu support
RUN apt-get update && apt-get install -y --no-install-recommends \
libgflags-dev \
libgtest-dev \
libiomp-dev \
libleveldb-dev \
liblmdb-dev \
libopencv-dev \
libopenmpi-dev \
libsnappy-dev \
openmpi-bin \
openmpi-doc \
python-numpy \
python-pydot \
python-setuptools \
python-scipy \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir \
flask \
graphviz \
jupyter \
matplotlib \
pydot \
python-nvd3 \
pyyaml \
requests \
scikit-image \
scipy \
setuptools \
tornado \
http://download.pytorch.org/whl/cpu/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl \
torchvision \
onnx \
onnx-caffe2
########## INSTALLATION STEPS ###################
RUN cd caffe2 && mkdir build && cd build \
&& cmake .. \
-DUSE_CUDA=OFF \
-DUSE_NNPACK=OFF \
-DUSE_ROCKSDB=OFF \
&& make -j"$(nproc)" install \
&& ldconfig \
&& make clean \
&& cd .. \
&& rm -rf build
RUN cd \
&& wget https://gist.githubusercontent.com/crcrpar/a06c1375449ee9bb73d0f5970afe9894/raw/244935526357ed16b41de1f876659d27890972a3/mnist_pytorch2caffe2.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment