Last active
July 25, 2020 02:32
-
-
Save colspan/d4ae6f2455af6030f49934d144d61b9f to your computer and use it in GitHub Desktop.
Dockerfile for PointPillars implementation
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
# Based on https://github.com/ufoym/deepo/blob/master/docker/Dockerfile.pytorch-py36-cu101 | |
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 | |
ENV LANG C.UTF-8 | |
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \ | |
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \ | |
GIT_CLONE="git clone --depth 10" && \ | |
rm -rf /var/lib/apt/lists/* \ | |
/etc/apt/sources.list.d/cuda.list \ | |
/etc/apt/sources.list.d/nvidia-ml.list && \ | |
apt-get update && \ | |
# ================================================================== | |
# tools | |
# ------------------------------------------------------------------ | |
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \ | |
build-essential \ | |
apt-utils \ | |
ca-certificates \ | |
wget \ | |
git \ | |
vim \ | |
libssl-dev \ | |
curl \ | |
unzip \ | |
unrar \ | |
libsparsehash-dev \ | |
&& \ | |
$GIT_CLONE https://github.com/Kitware/CMake ~/cmake && \ | |
cd ~/cmake && \ | |
./bootstrap && \ | |
make -j"$(nproc)" install && \ | |
# ================================================================== | |
# python | |
# ------------------------------------------------------------------ | |
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \ | |
software-properties-common \ | |
&& \ | |
add-apt-repository ppa:deadsnakes/ppa && \ | |
apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \ | |
python3.6 \ | |
python3.6-dev \ | |
python3-distutils-extra \ | |
&& \ | |
wget -O ~/get-pip.py \ | |
https://bootstrap.pypa.io/get-pip.py && \ | |
python3.6 ~/get-pip.py && \ | |
ln -s /usr/bin/python3.6 /usr/local/bin/python3 && \ | |
ln -s /usr/bin/python3.6 /usr/local/bin/python && \ | |
$PIP_INSTALL \ | |
setuptools \ | |
&& \ | |
$PIP_INSTALL \ | |
numpy \ | |
scipy \ | |
pandas \ | |
cloudpickle \ | |
scikit-image>=0.14.2 \ | |
scikit-learn \ | |
matplotlib \ | |
Cython \ | |
tqdm \ | |
&& \ | |
# ================================================================== | |
# pytorch | |
# ------------------------------------------------------------------ | |
$PIP_INSTALL \ | |
future \ | |
numpy \ | |
protobuf \ | |
enum34 \ | |
pyyaml \ | |
typing \ | |
&& \ | |
$PIP_INSTALL \ | |
torch==1.5.1+cu101 torchvision==0.6.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html \ | |
&& \ | |
# ================================================================== | |
# config & cleanup | |
# ------------------------------------------------------------------ | |
ldconfig && \ | |
apt-get clean && \ | |
apt-get autoremove && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* ~/* | |
RUN PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \ | |
$PIP_INSTALL \ | |
shapely fire pybind11 tensorboardX protobuf \ | |
scikit-image numba pillow | |
WORKDIR /root | |
RUN wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz | |
RUN tar xzvf boost_1_68_0.tar.gz | |
RUN cp -r ./boost_1_68_0/boost /usr/include | |
RUN rm -rf ./boost_1_68_0 | |
RUN rm -rf ./boost_1_68_0.tar.gz | |
RUN git clone https://github.com/traveller59/second.pytorch.git --depth 10 | |
RUN git clone https://github.com/traveller59/SparseConvNet.git --depth 10 | |
ENV TORCH_CUDA_ARCH_LIST Volta;Turing | |
RUN sed -i -e 's/c++11/c++14/g' SparseConvNet/setup.py | |
RUN cd ./SparseConvNet && python setup.py install && cd .. && rm -rf SparseConvNet | |
ENV NUMBAPRO_CUDA_DRIVER=/usr/lib/x86_64-linux-gnu/libcuda.so | |
ENV NUMBAPRO_NVVM=/usr/local/cuda/nvvm/lib64/libnvvm.so | |
ENV NUMBAPRO_LIBDEVICE=/usr/local/cuda/nvvm/libdevice | |
ENV PYTHONPATH=/root/second.pytorch | |
VOLUME ["/root/data"] | |
VOLUME ["/root/model"] | |
WORKDIR /root/second.pytorch/second | |
ENTRYPOINT ["fish"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment