From b4f8ec42e0a2ef4147114d1d0473735727c389ef Mon Sep 17 00:00:00 2001 From: MSalvaris Date: Tue, 4 Sep 2018 19:16:29 +0100 Subject: [PATCH] Updating pytorch dockerfile --- .../docker/pytorch/dockerfile | 68 +++++++++++++++---- 1 file changed, 55 insertions(+), 13 deletions(-) diff --git a/{{cookiecutter.repo_name}}/docker/pytorch/dockerfile b/{{cookiecutter.repo_name}}/docker/pytorch/dockerfile index 24e018e..89a96e9 100644 --- a/{{cookiecutter.repo_name}}/docker/pytorch/dockerfile +++ b/{{cookiecutter.repo_name}}/docker/pytorch/dockerfile @@ -1,23 +1,65 @@ -FROM masalvar/pytorch_base - +FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04 + RUN apt-get update && apt-get install -y --no-install-recommends \ - iproute2 \ - git \ - locales\ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + build-essential \ + ca-certificates \ + cmake \ + git \ + iproute2 \ + locales \ + pandoc \ + software-properties-common \ + wget \ + vim && \ + rm -rf /var/lib/apt/lists/* \ + /etc/apt/sources.list.d/cuda.list \ + /etc/apt/sources.list.d/nvidia-ml.list RUN locale-gen en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -RUN conda install --name pytorch-py35 jupyter +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt-get update && apt-get install -y --no-install-recommends \ + python3.6 \ + python3.6-dev \ + libatlas-base-dev \ + graphviz + +RUN 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 + +RUN python -m pip --no-cache-dir install --upgrade \ + setuptools \ + numpy \ + scipy \ + pandas \ + scikit-learn \ + matplotlib \ + Cython \ + graphviz \ + fire \ + toolz \ + jupyter \ + ipykernel \ + papermill \ + http://download.pytorch.org/whl/cu90/torch-0.4.1-cp36-cp36m-linux_x86_64.whl \ + torchvision + + +RUN ldconfig && \ + apt-get clean && \ + apt-get autoremove && \ + rm -rf /var/lib/apt/lists/* /tmp/* ~/* + + +RUN git clone https://github.com/msalvaris/gpu_monitor.git && \ + pip install -r gpu_monitor/requirements.txt && \ + pip install -e gpu_monitor -RUN bash -c "source activate pytorch-py35 && \ - pip install fire toolz scikit-learn papermill && \ - git clone https://github.com/msalvaris/gpu_monitor.git && \ - pip install -r gpu_monitor/requirements.txt && \ - pip install -e gpu_monitor"