forked from EdinburghNLP/nematus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.gpu
52 lines (42 loc) · 1.21 KB
/
Dockerfile.gpu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM nvidia/cuda:8.0-cudnn5-devel
MAINTAINER Tom Kocmi <kocmi@ufal.mff.cuni.cz>
# Install git, wget, python-dev, pip and other dependencies
RUN apt-get update && apt-get install -y \
git \
wget \
cmake \
vim \
nano \
python3 \
libopenblas-dev \
python-dev \
python-pip \
python-nose \
python-numpy \
python-scipy \
python-pygraphviz \
xml-twig-tools
RUN pip install --upgrade pip
RUN pip install -U setuptools
RUN pip install numexpr cython ipdb
# Set CUDA_ROOT
ENV CUDA_ROOT /usr/local/cuda/bin
# Install bleeding-edge Theano
RUN pip install --upgrade --no-deps theano
# Set up .theanorc for CUDA
RUN echo "[global]\ndevice=gpu\nfloatX=float32\noptimizer_including=cudnn\n[lib]\ncnmem=0.1\n[nvcc]\nfastmath=True" > /root/.theanorc
RUN mkdir -p /path/to
WORKDIR /path/to/
# Install mosesdecoder
RUN git clone https://github.com/moses-smt/mosesdecoder
# Install subwords
RUN git clone https://github.com/rsennrich/subword-nmt
# Install nematus
COPY . /path/to/nematus
WORKDIR /path/to/nematus
RUN python setup.py install
WORKDIR /
# playground will contain user defined scripts, it should be run as:
# nvidia-docker run -v `pwd`:/playground -it nematus-docker
RUN mkdir playground
WORKDIR /playground