From a31c1fd1fa2413bc00f39ff5e41ccdc5c538e314 Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Sun, 11 Jun 2017 15:20:22 +0100 Subject: [PATCH 01/13] Update imports to support TensorFlow v1.2. --- seq2seq/contrib/seq2seq/helper.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/seq2seq/contrib/seq2seq/helper.py b/seq2seq/contrib/seq2seq/helper.py index 977d0ab9..353a1386 100644 --- a/seq2seq/contrib/seq2seq/helper.py +++ b/seq2seq/contrib/seq2seq/helper.py @@ -32,8 +32,13 @@ import six -from tensorflow.contrib.distributions.python.ops import bernoulli -from tensorflow.contrib.distributions.python.ops import categorical +try: + from tensorflow.python.ops.distributions import bernoulli + from tensorflow.python.ops.distributions import categorical +except: + # Backwards compatibility with TensorFlow prior to 1.2. + from tensorflow.contrib.distributions.python.ops import bernoulli + from tensorflow.contrib.distributions.python.ops import categorical from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.layers import base as layers_base From 8053094a02340492e8f2ff5e594714dd7b17071d Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Sun, 11 Jun 2017 15:18:50 +0100 Subject: [PATCH 02/13] Fix typo in hooks_test.py. --- seq2seq/test/hooks_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seq2seq/test/hooks_test.py b/seq2seq/test/hooks_test.py index dedc6594..a04cdabc 100644 --- a/seq2seq/test/hooks_test.py +++ b/seq2seq/test/hooks_test.py @@ -39,7 +39,7 @@ class TestPrintModelAnalysisHook(tf.test.TestCase): def test_begin(self): model_dir = tempfile.mkdtemp() outfile = tempfile.NamedTemporaryFile() - tf.get_variable("weigths", [128, 128]) + tf.get_variable("weights", [128, 128]) hook = hooks.PrintModelAnalysisHook( params={}, model_dir=model_dir, run_config=tf.contrib.learn.RunConfig()) hook.begin() @@ -125,7 +125,7 @@ def tearDown(self): def test_capture(self): global_step = tf.contrib.framework.get_or_create_global_step() # Some test computation - some_weights = tf.get_variable("weigths", [2, 128]) + some_weights = tf.get_variable("weights", [2, 128]) computation = tf.nn.softmax(some_weights) hook = hooks.MetadataCaptureHook( From 4448976cbc0854ae406b4cfeeb235b705b95102a Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Sun, 11 Jun 2017 15:19:27 +0100 Subject: [PATCH 03/13] Update hooks_test.py to work with TensorFlow 1.2. --- seq2seq/test/hooks_test.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/seq2seq/test/hooks_test.py b/seq2seq/test/hooks_test.py index a04cdabc..70d395e7 100644 --- a/seq2seq/test/hooks_test.py +++ b/seq2seq/test/hooks_test.py @@ -24,6 +24,7 @@ import tempfile import shutil import time +from distutils.version import LooseVersion import tensorflow as tf from tensorflow.python.training import monitored_session # pylint: disable=E0611 @@ -47,8 +48,14 @@ def test_begin(self): with gfile.GFile(os.path.join(model_dir, "model_analysis.txt")) as file: file_contents = file.read().strip() - self.assertEqual(file_contents.decode(), "_TFProfRoot (--/16.38k params)\n" - " weigths (128x128, 16.38k/16.38k params)") + if LooseVersion(tf.VERSION) < LooseVersion("1.2.0"): + self.assertEqual(file_contents.decode(), "_TFProfRoot (--/16.38k params)\n" + " weights (128x128, 16.38k/16.38k params)") + else: + self.assertEqual(file_contents.decode(), "node name | # parameters\n" + "_TFProfRoot (--/16.38k params)\n" + " weights (128x128, 16.38k/16.38k params)") + outfile.close() From f85d026c0f7bff2c06c991012271e4c4fd1af1a6 Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Sun, 11 Jun 2017 18:03:43 +0100 Subject: [PATCH 04/13] Fix hooks_test.py on Python 3. Fixes the following error when running the tests on Python 3. Traceback (most recent call last): File "seq2seq/seq2seq/test/hooks_test.py", line 55, in test_begin self.assertEqual(file_contents.decode(), ...) AttributeError: 'str' object has no attribute 'decode' --- seq2seq/test/hooks_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seq2seq/test/hooks_test.py b/seq2seq/test/hooks_test.py index 70d395e7..8fe4db01 100644 --- a/seq2seq/test/hooks_test.py +++ b/seq2seq/test/hooks_test.py @@ -49,10 +49,10 @@ def test_begin(self): file_contents = file.read().strip() if LooseVersion(tf.VERSION) < LooseVersion("1.2.0"): - self.assertEqual(file_contents.decode(), "_TFProfRoot (--/16.38k params)\n" + self.assertEqual(tf.compat.as_text(file_contents), "_TFProfRoot (--/16.38k params)\n" " weights (128x128, 16.38k/16.38k params)") else: - self.assertEqual(file_contents.decode(), "node name | # parameters\n" + self.assertEqual(tf.compat.as_text(file_contents), "node name | # parameters\n" "_TFProfRoot (--/16.38k params)\n" " weights (128x128, 16.38k/16.38k params)") From 83d592f2e9d00c6cb1597fd27b8dcdd2b3277e70 Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Sun, 11 Jun 2017 18:21:40 +0100 Subject: [PATCH 05/13] Another go at fixing hooks_test.py. distutils.version isn't available on the CI versions, so change the test to not rely explicitly on the version of TensorFlow installed. --- seq2seq/test/hooks_test.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/seq2seq/test/hooks_test.py b/seq2seq/test/hooks_test.py index 8fe4db01..abea8125 100644 --- a/seq2seq/test/hooks_test.py +++ b/seq2seq/test/hooks_test.py @@ -24,7 +24,6 @@ import tempfile import shutil import time -from distutils.version import LooseVersion import tensorflow as tf from tensorflow.python.training import monitored_session # pylint: disable=E0611 @@ -48,13 +47,13 @@ def test_begin(self): with gfile.GFile(os.path.join(model_dir, "model_analysis.txt")) as file: file_contents = file.read().strip() - if LooseVersion(tf.VERSION) < LooseVersion("1.2.0"): - self.assertEqual(tf.compat.as_text(file_contents), "_TFProfRoot (--/16.38k params)\n" - " weights (128x128, 16.38k/16.38k params)") - else: - self.assertEqual(tf.compat.as_text(file_contents), "node name | # parameters\n" - "_TFProfRoot (--/16.38k params)\n" - " weights (128x128, 16.38k/16.38k params)") + lines = tf.compat.as_text(file_contents).split("\n") + if len(lines) == 3: + # TensorFlow v1.2 includes an extra header line + self.assertEqual(lines[0], "node name | # parameters") + + self.assertEqual(lines[-2], "_TFProfRoot (--/16.38k params)") + self.assertEqual(lines[-1], " weights (128x128, 16.38k/16.38k params)") outfile.close() From 52c0704ad746122f969f13dcb71bb99f07e4dc91 Mon Sep 17 00:00:00 2001 From: ReDeiPirati Date: Fri, 16 Jun 2017 16:39:37 +0200 Subject: [PATCH 06/13] Now is possible to run Tf-Seq2Seq via Docker --- seq2seq/tools/docker/README.md | 99 +++++++++++++++++++ seq2seq/tools/docker/py27/Dockerfile | 31 ++++++ seq2seq/tools/docker/py27/Dockerfile.devel | 30 ++++++ .../tools/docker/py27/Dockerfile.devel-gpu | 30 ++++++ seq2seq/tools/docker/py27/Dockerfile.gpu | 31 ++++++ seq2seq/tools/docker/py35/Dockerfile | 31 ++++++ seq2seq/tools/docker/py35/Dockerfile.devel | 30 ++++++ .../tools/docker/py35/Dockerfile.devel-gpu | 30 ++++++ seq2seq/tools/docker/py35/Dockerfile.gpu | 31 ++++++ 9 files changed, 343 insertions(+) create mode 100644 seq2seq/tools/docker/README.md create mode 100644 seq2seq/tools/docker/py27/Dockerfile create mode 100644 seq2seq/tools/docker/py27/Dockerfile.devel create mode 100644 seq2seq/tools/docker/py27/Dockerfile.devel-gpu create mode 100644 seq2seq/tools/docker/py27/Dockerfile.gpu create mode 100644 seq2seq/tools/docker/py35/Dockerfile create mode 100644 seq2seq/tools/docker/py35/Dockerfile.devel create mode 100644 seq2seq/tools/docker/py35/Dockerfile.devel-gpu create mode 100644 seq2seq/tools/docker/py35/Dockerfile.gpu diff --git a/seq2seq/tools/docker/README.md b/seq2seq/tools/docker/README.md new file mode 100644 index 00000000..b3f0b59b --- /dev/null +++ b/seq2seq/tools/docker/README.md @@ -0,0 +1,99 @@ +# Using TF-Seq2Seq via Docker + +This directory contains `Dockerfile`s to make it easy to get up and running with +TensorFlow via [Docker](https://www.docker.com/). + + +## Installing Docker + +General installation instructions are +[on the Docker site](https://docs.docker.com/), but we give some +quick links here: + +* [Docker for Mac OSX](https://www.docker.com/docker-mac) +* [Docker for Windows PC](https://www.docker.com/docker-windows) +* [Docker for Debian](https://www.docker.com/docker-debian) +* [Docker for Ubuntu](https://www.docker.com/docker-ubuntu) +* [Docker for CentOS Distribution](https://www.docker.com/docker-centos-distribution) + + +## Dockerfile + +At the moment we haven't deploy an automatic pipeline to build container, so we provide the Dockerfiles to build containers. +This directory is structured to maintain Dockerfile for python2.7(py27) and python3.5(py35). + +* `Dockerfile` - TF-Seq2Seq - CPU only! + +* `Dockerfile.devel` - Developer build for TF-Seq2Seq - CPU only + +* `Dockerfile.gpu` - TF-Seq2Seq with support of NVidia CUDA + +* `Dockerfile.devel-gpu` - Developer build for TF-Seq2Seq with support of NVidia CUDA + +The file above, are built from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) and with **lastest** TensorFlow version/tags. + + +## Build your image + +To build the container's image run in the directory of your favorite python version(some_path/seq2seq/seq2seq/tools/docker/{python-version}/): + + $ docker build -t {python-version}-{tags}(this will be the repository name of your images) -f Dockerfile.suffix . + + +Some examples +``` + # In py27 dir + $ docker build -t py27 -f Dockerfile . + $ docker build -t py27-devel-gpu -f Dockerfile.devel-gpu . + + # In py35 dir + $ docker build -t py35-devel -f Dockerfile.devel . + $ docker build -t py35-gpu -f Dockerfile.gpu . +``` + +To build a container with a certain TensorFlow version, look at the tags/version in the [Docker Store](https://store.docker.com/community/images/tensorflow/tensorflow/tags), then change the first line's tags of the Dockerfile with your choice: + +Some examples: +``` + # In py27 Dockerfile, with the TensorFlow 1.0.1 version + FROM tensorflow/tensorflow:latest --Became--> FROM tensorflow/tensorflow:1.0.1 + + #In py35 Dockerfile.devel-gpu, with the TensorFlow 1.1.0-rc2 version + FROM tensorflow/tensorflow:latest-devel-gpu-py3 --Became--> 1.2.0-rc2-devel-gpu-py3 +``` + +Once a container is built, you will find the Tf-Seq2Seq package in the `/src/seq2seq` path(the default workdir). + +## Running the container + +Run non-GPU container using + + $ docker run -it -p hostPort:containerPort {repository_name}(provided during the building step) + +Some examples +``` + # Run a container with the Tf-Seq2Seq package in a py27 developer env + $ docker run -it py27-devel + + # Run a container with the Tf-Seq2Seq package in a py35 env and look at the result with TensorBoard + $ docker run -it -p 6006:6006 py35 + + # Run a container with the Tf-Seq2Seq package in a py27 env and work at a Tf-seq2seq package cloned in the Host through the container + $ docker run -it -v $(pwd):/seq2seq -w /seq2seq py27 + +``` + +For GPU support install NVidia drivers (ideally latest) and +[nvidia-docker](https://github.com/NVIDIA/nvidia-docker). Run using + + $ nvidia-docker run -it -p hostPort:containerPort {repository_name}(provided during the building step) + +The examples are same as above with the only difference that the command is `nvidia-docker`. + +Note: If you would have a problem running nvidia-docker you may try the old method +we have used. But it is not recommended. If you find a bug in nvidia-docker, please report +it there and try using nvidia-docker as described above. + + $ export CUDA_SO=$(\ls /usr/lib/x86_64-linux-gnu/libcuda.* | xargs -I{} echo '-v {}:{}') + $ export DEVICES=$(\ls /dev/nvidia* | xargs -I{} echo '--device {}:{}') + $ docker run -it -p 8888:8888 $CUDA_SO $DEVICES gcr.io/tensorflow/tensorflow:latest-gpu diff --git a/seq2seq/tools/docker/py27/Dockerfile b/seq2seq/tools/docker/py27/Dockerfile new file mode 100644 index 00000000..96983e37 --- /dev/null +++ b/seq2seq/tools/docker/py27/Dockerfile @@ -0,0 +1,31 @@ +FROM tensorflow/tensorflow:latest + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + git \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/seq2seq/tools/docker/py27/Dockerfile.devel b/seq2seq/tools/docker/py27/Dockerfile.devel new file mode 100644 index 00000000..c8b14c10 --- /dev/null +++ b/seq2seq/tools/docker/py27/Dockerfile.devel @@ -0,0 +1,30 @@ +FROM tensorflow/tensorflow:latest-devel + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/seq2seq/tools/docker/py27/Dockerfile.devel-gpu b/seq2seq/tools/docker/py27/Dockerfile.devel-gpu new file mode 100644 index 00000000..7e77c82a --- /dev/null +++ b/seq2seq/tools/docker/py27/Dockerfile.devel-gpu @@ -0,0 +1,30 @@ +FROM tensorflow/tensorflow:latest-devel-gpu + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/seq2seq/tools/docker/py27/Dockerfile.gpu b/seq2seq/tools/docker/py27/Dockerfile.gpu new file mode 100644 index 00000000..21fd55ed --- /dev/null +++ b/seq2seq/tools/docker/py27/Dockerfile.gpu @@ -0,0 +1,31 @@ +FROM tensorflow/tensorflow:latest-gpu + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + git \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/seq2seq/tools/docker/py35/Dockerfile b/seq2seq/tools/docker/py35/Dockerfile new file mode 100644 index 00000000..3ef232df --- /dev/null +++ b/seq2seq/tools/docker/py35/Dockerfile @@ -0,0 +1,31 @@ +FROM tensorflow/tensorflow:latest-py3 + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + git \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip3.5 --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip3.5 --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/seq2seq/tools/docker/py35/Dockerfile.devel b/seq2seq/tools/docker/py35/Dockerfile.devel new file mode 100644 index 00000000..d66cd2fa --- /dev/null +++ b/seq2seq/tools/docker/py35/Dockerfile.devel @@ -0,0 +1,30 @@ +FROM tensorflow/tensorflow:latest-devel-py3 + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip3.5 --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip3.5 --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/seq2seq/tools/docker/py35/Dockerfile.devel-gpu b/seq2seq/tools/docker/py35/Dockerfile.devel-gpu new file mode 100644 index 00000000..278f0271 --- /dev/null +++ b/seq2seq/tools/docker/py35/Dockerfile.devel-gpu @@ -0,0 +1,30 @@ +FROM tensorflow/tensorflow:latest-devel-gpu-py3 + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip3.5 --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip3.5 --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/seq2seq/tools/docker/py35/Dockerfile.gpu b/seq2seq/tools/docker/py35/Dockerfile.gpu new file mode 100644 index 00000000..b132f2f0 --- /dev/null +++ b/seq2seq/tools/docker/py35/Dockerfile.gpu @@ -0,0 +1,31 @@ +FROM tensorflow/tensorflow:latest-gpu-py3 + +MAINTAINER Alessio Gozzoli + +RUN apt-get update && apt-get install -y \ + python-tk \ + python3-tk \ + git \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install Seq2Seq Dependencies +WORKDIR / +RUN pip3.5 --no-cache-dir install -e git+https://github.com/google/seq2seq.git#egg=seq2seq && \ + pip3.5 --no-cache-dir install \ + nose \ + pylint \ + tox \ + yapf \ + mkdocs + +# Set Matploblib Backend +RUN mkdir -p /root/.config/matplotlib/ && \ + touch /root/.config/matplotlib/matplotlibrc && \ + echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc + +# Default workdir +WORKDIR "/src/seq2seq" + +CMD ["/bin/bash"] \ No newline at end of file From 6b5bc7128ff0c1bccfd3766b8067e882b5cec274 Mon Sep 17 00:00:00 2001 From: ReDeiPirati Date: Fri, 16 Jun 2017 16:49:53 +0200 Subject: [PATCH 07/13] Fix typo on Docker README --- seq2seq/tools/docker/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/seq2seq/tools/docker/README.md b/seq2seq/tools/docker/README.md index b3f0b59b..ea336ef9 100644 --- a/seq2seq/tools/docker/README.md +++ b/seq2seq/tools/docker/README.md @@ -1,7 +1,7 @@ # Using TF-Seq2Seq via Docker This directory contains `Dockerfile`s to make it easy to get up and running with -TensorFlow via [Docker](https://www.docker.com/). +TF-Seq2Seq via [Docker](https://www.docker.com/). ## Installing Docker @@ -19,18 +19,18 @@ quick links here: ## Dockerfile -At the moment we haven't deploy an automatic pipeline to build container, so we provide the Dockerfiles to build containers. +At the moment we haven't deployed an automatic pipeline to build container, so we provide the Dockerfile to build images This directory is structured to maintain Dockerfile for python2.7(py27) and python3.5(py35). * `Dockerfile` - TF-Seq2Seq - CPU only! -* `Dockerfile.devel` - Developer build for TF-Seq2Seq - CPU only +* `Dockerfile.devel` - Developer build for TF-Seq2Seq - CPU only! * `Dockerfile.gpu` - TF-Seq2Seq with support of NVidia CUDA * `Dockerfile.devel-gpu` - Developer build for TF-Seq2Seq with support of NVidia CUDA -The file above, are built from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) and with **lastest** TensorFlow version/tags. +The file above, are coded from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) and with **latest** TensorFlow version/tags. ## Build your image @@ -88,7 +88,7 @@ For GPU support install NVidia drivers (ideally latest) and $ nvidia-docker run -it -p hostPort:containerPort {repository_name}(provided during the building step) -The examples are same as above with the only difference that the command is `nvidia-docker`. +The examples are the same as above with the only difference that the command is `nvidia-docker`. Note: If you would have a problem running nvidia-docker you may try the old method we have used. But it is not recommended. If you find a bug in nvidia-docker, please report From 14e63d41a3fc2197db1dc887c3d6ff74313b524d Mon Sep 17 00:00:00 2001 From: ReDeiPirati Date: Fri, 16 Jun 2017 16:56:28 +0200 Subject: [PATCH 08/13] Add PackageName in README and fix typo in nmt --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d3941937..75384cdf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# TF-Seq2Seq (v0.1.0) + [![CircleCI](https://circleci.com/gh/google/seq2seq.svg?style=svg)](https://circleci.com/gh/google/seq2seq) --- From f409d3dd8e6590cef2fbbeea5390747c2bf4174a Mon Sep 17 00:00:00 2001 From: ReDeiPirati Date: Fri, 16 Jun 2017 17:50:16 +0200 Subject: [PATCH 09/13] Fix some typo and Update the Getting started with the Docker installation --- docs/getting_started.md | 86 +++++++++++++++++++++++++++++++++- docs/nmt.md | 2 +- seq2seq/tools/docker/README.md | 51 ++++++++++---------- 3 files changed, 112 insertions(+), 27 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 43cdba6c..fe7f3cc8 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -1,7 +1,7 @@ ## Download & Setup To use tf-seq2seq you need a working installation of TensorFlow 1.0 with -Python 2.7 or Python 3.5. Follow the [TensorFlow Getting Started](https://www.tensorflow.org/versions/r1.0/get_started/os_setup) guide for detailed setup instructions. With TensorFlow installed, you can clone this repository: +Python 2.7 or Python 3.5. Follow the [Installing TensorFlow](https://www.tensorflow.org/install/) guide for detailed setup instructions. With TensorFlow installed, you can clone this repository: ```bash git clone https://github.com/google/seq2seq.git @@ -11,12 +11,96 @@ cd seq2seq pip install -e . ``` +## TF-Seq2Seq via Docker + +Now is possible to run [tf-seq2seq via Docker](https://github.com/google/seq2seq/seq2seq/tools/docker). Unfortunately, we haven't deployed an automatic pipeline to build container, so we provide the Dockerfile to build images for your repository. + +### Build Image +First of all you have to build the image for running tf-seq2seq, according to your python preference(python2.7 or python3.5) and hardware capabilities(with or without GPU) from the right Dockerfile + +* [Docker for Python 2.7](https://github.com/google/seq2seq/seq2seq/tools/docker/py27) +* [Docker for Python 3.5](https://github.com/google/seq2seq/seq2seq/tools/docker/py35) + +Both the directory have Dockerfile to build image with basic depenecies(Dockerfile), development dependecies(Dockerfile.devel) and GPU support(Dockerfile.gpu and Dockerfile.devel-gpu). The file provided, are coded from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) with **latest** TensorFlow version/tags. +Now you are ready to build the image(you have to be in py27 or py35 dir to run this command): + +```bash +$ docker build -t image_name -f Dockerfile.suffix . +``` + +We give you some examples: +```bash +# In py27 dir +$ docker build -t py27 -f Dockerfile . +$ docker build -t py27-devel-gpu -f Dockerfile.devel-gpu . + +# In py35 dir +$ docker build -t py35-devel -f Dockerfile.devel . +$ docker build -t py35-gpu -f Dockerfile.gpu . +``` + +### Build Custom Image +To build a container with a certain TensorFlow version, look at the tags/version in the [Docker Store](https://store.docker.com/community/images/tensorflow/tensorflow/tags), then change the first line's tags of the Dockerfile with your choice and run the `docker build` command. + +Some examples: +``` +# In py27 Dockerfile, with the TensorFlow 1.0.1 version +FROM tensorflow/tensorflow:latest --Became--> FROM tensorflow/tensorflow:1.0.1 + +#In py35 Dockerfile.devel-gpu, with the TensorFlow 1.1.0-rc2 version +FROM tensorflow/tensorflow:latest-devel-gpu-py3 --Became--> 1.2.0-rc2-devel-gpu-py3 +``` + +Once a container is built, you will find the Tf-Seq2Seq package in the `/src/seq2seq` path(the default workdir). + +### Running container + +Run non-GPU container using + + $ docker run -it -p hostPort:containerPort image_name(provided during the building step) + +Some examples +```bash +# Run a container with the Tf-Seq2Seq package in a py27 developer env +$ docker run -it py27-devel + +# Run a container with the Tf-Seq2Seq package in a py35 env and look at the result with TensorBoard +$ docker run -it -p 6006:6006 py35 + +# Run a container with the Tf-Seq2Seq package in a py27 env and work at a Tf-seq2seq package cloned in the Host through the container +$ docker run -it -v $(pwd):/seq2seq -w /seq2seq py27 +``` + +For GPU support install NVidia drivers (ideally latest) and +[nvidia-docker](https://github.com/NVIDIA/nvidia-docker). Run using + + $ nvidia-docker run -it -p hostPort:containerPort {repository_name}(provided during the building step) + +The examples are the same as above with the only difference that the command is `nvidia-docker`. + +Note: If you would have a problem running nvidia-docker you may try the old method +we have used. But it is not recommended. If you find a bug in nvidia-docker, please report +it there and try using nvidia-docker as described above. + +```bash + $ export CUDA_SO=$(\ls /usr/lib/x86_64-linux-gnu/libcuda.* | xargs -I{} echo '-v {}:{}') + $ export DEVICES=$(\ls /dev/nvidia* | xargs -I{} echo '--device {}:{}') + $ docker run -it -p 8888:8888 $CUDA_SO $DEVICES gcr.io/tensorflow/tensorflow:latest-gpu +``` + +## Validate your installation + To make sure everything works as expect you can run a simple pipeline unit test: ```bash python -m unittest seq2seq.test.pipeline_test ``` +Or the full test pipeline(you have to download nose if you haven't installed the tf-seq2seq via Docker): +```bash +nosetests +``` + If you see a "OK" message, you are all set. Note that you may need to install pyrouge, pyyaml, and matplotlib, in order for these tests to pass. If you run into other setup issues, please [file a Github issue](https://github.com/google/seq2seq/issues). diff --git a/docs/nmt.md b/docs/nmt.md index ce6393b5..9e9de68f 100644 --- a/docs/nmt.md +++ b/docs/nmt.md @@ -255,7 +255,7 @@ The above command also demonstrates how to pass several tasks to the inference s ### Evaluating specific checkpoint -The training script will save multiple model checkpoints throughout training. The exact checkpoint behavior can be controlled via [training script flags](training/). By default, the inference script evaluates the latest checkpoint in the model directory. To evaluate a specific checkpiint you can pass the `checkpoint_path` flag. +The training script will save multiple model checkpoints throughout training. The exact checkpoint behavior can be controlled via [training script flags](training/). By default, the inference script evaluates the latest checkpoint in the model directory. To evaluate a specific checkpoint you can pass the `checkpoint_path` flag. ## Calcuating BLEU scores diff --git a/seq2seq/tools/docker/README.md b/seq2seq/tools/docker/README.md index ea336ef9..bf99d4c3 100644 --- a/seq2seq/tools/docker/README.md +++ b/seq2seq/tools/docker/README.md @@ -30,57 +30,56 @@ This directory is structured to maintain Dockerfile for python2.7(py27) and pyth * `Dockerfile.devel-gpu` - Developer build for TF-Seq2Seq with support of NVidia CUDA -The file above, are coded from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) and with **latest** TensorFlow version/tags. +The file provided, are coded from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) and with **latest** TensorFlow version/tags. -## Build your image +## Build image To build the container's image run in the directory of your favorite python version(some_path/seq2seq/seq2seq/tools/docker/{python-version}/): - $ docker build -t {python-version}-{tags}(this will be the repository name of your images) -f Dockerfile.suffix . + $ docker build -t image_name -f Dockerfile.suffix . Some examples -``` - # In py27 dir - $ docker build -t py27 -f Dockerfile . - $ docker build -t py27-devel-gpu -f Dockerfile.devel-gpu . - - # In py35 dir - $ docker build -t py35-devel -f Dockerfile.devel . - $ docker build -t py35-gpu -f Dockerfile.gpu . +```bash +# In py27 dir +$ docker build -t py27 -f Dockerfile . +$ docker build -t py27-devel-gpu -f Dockerfile.devel-gpu . + +# In py35 dir +$ docker build -t py35-devel -f Dockerfile.devel . +$ docker build -t py35-gpu -f Dockerfile.gpu . ``` To build a container with a certain TensorFlow version, look at the tags/version in the [Docker Store](https://store.docker.com/community/images/tensorflow/tensorflow/tags), then change the first line's tags of the Dockerfile with your choice: Some examples: ``` - # In py27 Dockerfile, with the TensorFlow 1.0.1 version - FROM tensorflow/tensorflow:latest --Became--> FROM tensorflow/tensorflow:1.0.1 +# In py27 Dockerfile, with the TensorFlow 1.0.1 version +FROM tensorflow/tensorflow:latest --Became--> FROM tensorflow/tensorflow:1.0.1 - #In py35 Dockerfile.devel-gpu, with the TensorFlow 1.1.0-rc2 version - FROM tensorflow/tensorflow:latest-devel-gpu-py3 --Became--> 1.2.0-rc2-devel-gpu-py3 +#In py35 Dockerfile.devel-gpu, with the TensorFlow 1.1.0-rc2 version +FROM tensorflow/tensorflow:latest-devel-gpu-py3 --Became--> 1.2.0-rc2-devel-gpu-py3 ``` Once a container is built, you will find the Tf-Seq2Seq package in the `/src/seq2seq` path(the default workdir). -## Running the container +## Running container Run non-GPU container using - $ docker run -it -p hostPort:containerPort {repository_name}(provided during the building step) + $ docker run -it -p hostPort:containerPort image_name(provided during the building step) Some examples -``` - # Run a container with the Tf-Seq2Seq package in a py27 developer env - $ docker run -it py27-devel +```bash +# Run a container with the Tf-Seq2Seq package in a py27 developer env +$ docker run -it py27-devel - # Run a container with the Tf-Seq2Seq package in a py35 env and look at the result with TensorBoard - $ docker run -it -p 6006:6006 py35 - - # Run a container with the Tf-Seq2Seq package in a py27 env and work at a Tf-seq2seq package cloned in the Host through the container - $ docker run -it -v $(pwd):/seq2seq -w /seq2seq py27 +# Run a container with the Tf-Seq2Seq package in a py35 env and look at the result with TensorBoard +$ docker run -it -p 6006:6006 py35 +# Run a container with the Tf-Seq2Seq package in a py27 env and work at a Tf-seq2seq package cloned in the Host through the container +$ docker run -it -v $(pwd):/seq2seq -w /seq2seq py27 ``` For GPU support install NVidia drivers (ideally latest) and @@ -94,6 +93,8 @@ Note: If you would have a problem running nvidia-docker you may try the old meth we have used. But it is not recommended. If you find a bug in nvidia-docker, please report it there and try using nvidia-docker as described above. +```bash $ export CUDA_SO=$(\ls /usr/lib/x86_64-linux-gnu/libcuda.* | xargs -I{} echo '-v {}:{}') $ export DEVICES=$(\ls /dev/nvidia* | xargs -I{} echo '--device {}:{}') $ docker run -it -p 8888:8888 $CUDA_SO $DEVICES gcr.io/tensorflow/tensorflow:latest-gpu +``` From 8b8f3f22f4f64c96c1933f66f1594a90a3777cb9 Mon Sep 17 00:00:00 2001 From: ReDeiPirati Date: Fri, 16 Jun 2017 17:58:10 +0200 Subject: [PATCH 10/13] Fix Dockefile missing /n --- seq2seq/tools/docker/py27/Dockerfile | 2 +- seq2seq/tools/docker/py27/Dockerfile.devel | 2 +- seq2seq/tools/docker/py27/Dockerfile.devel-gpu | 2 +- seq2seq/tools/docker/py27/Dockerfile.gpu | 2 +- seq2seq/tools/docker/py35/Dockerfile | 2 +- seq2seq/tools/docker/py35/Dockerfile.devel | 2 +- seq2seq/tools/docker/py35/Dockerfile.devel-gpu | 2 +- seq2seq/tools/docker/py35/Dockerfile.gpu | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/seq2seq/tools/docker/py27/Dockerfile b/seq2seq/tools/docker/py27/Dockerfile index 96983e37..47835822 100644 --- a/seq2seq/tools/docker/py27/Dockerfile +++ b/seq2seq/tools/docker/py27/Dockerfile @@ -28,4 +28,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/seq2seq/tools/docker/py27/Dockerfile.devel b/seq2seq/tools/docker/py27/Dockerfile.devel index c8b14c10..6f8e3ae5 100644 --- a/seq2seq/tools/docker/py27/Dockerfile.devel +++ b/seq2seq/tools/docker/py27/Dockerfile.devel @@ -27,4 +27,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/seq2seq/tools/docker/py27/Dockerfile.devel-gpu b/seq2seq/tools/docker/py27/Dockerfile.devel-gpu index 7e77c82a..283f2b65 100644 --- a/seq2seq/tools/docker/py27/Dockerfile.devel-gpu +++ b/seq2seq/tools/docker/py27/Dockerfile.devel-gpu @@ -27,4 +27,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/seq2seq/tools/docker/py27/Dockerfile.gpu b/seq2seq/tools/docker/py27/Dockerfile.gpu index 21fd55ed..e20462fa 100644 --- a/seq2seq/tools/docker/py27/Dockerfile.gpu +++ b/seq2seq/tools/docker/py27/Dockerfile.gpu @@ -28,4 +28,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/seq2seq/tools/docker/py35/Dockerfile b/seq2seq/tools/docker/py35/Dockerfile index 3ef232df..555c21d9 100644 --- a/seq2seq/tools/docker/py35/Dockerfile +++ b/seq2seq/tools/docker/py35/Dockerfile @@ -28,4 +28,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/seq2seq/tools/docker/py35/Dockerfile.devel b/seq2seq/tools/docker/py35/Dockerfile.devel index d66cd2fa..3d819e85 100644 --- a/seq2seq/tools/docker/py35/Dockerfile.devel +++ b/seq2seq/tools/docker/py35/Dockerfile.devel @@ -27,4 +27,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/seq2seq/tools/docker/py35/Dockerfile.devel-gpu b/seq2seq/tools/docker/py35/Dockerfile.devel-gpu index 278f0271..5dd9c659 100644 --- a/seq2seq/tools/docker/py35/Dockerfile.devel-gpu +++ b/seq2seq/tools/docker/py35/Dockerfile.devel-gpu @@ -27,4 +27,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/seq2seq/tools/docker/py35/Dockerfile.gpu b/seq2seq/tools/docker/py35/Dockerfile.gpu index b132f2f0..ae5c5d1b 100644 --- a/seq2seq/tools/docker/py35/Dockerfile.gpu +++ b/seq2seq/tools/docker/py35/Dockerfile.gpu @@ -28,4 +28,4 @@ RUN mkdir -p /root/.config/matplotlib/ && \ # Default workdir WORKDIR "/src/seq2seq" -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] From ffb1505655b3e3836b054da2b0b2981da2e29a5c Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Sun, 18 Jun 2017 14:36:28 +0100 Subject: [PATCH 11/13] Tell pylint about the tf contextmanager. Use of `tf.name_scope` and `tf.variable_scope` cause pylint errors on TF1.2 due to pylint not fully understanding the `tf_contextlib.contextmanager` decorators. --- pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylintrc b/pylintrc index 2a182c2f..0e75ca0c 100644 --- a/pylintrc +++ b/pylintrc @@ -292,7 +292,7 @@ generated-members=set_shape,np.float32 # List of decorators that produce context managers, such as # contextlib.contextmanager. Add to this list to register other decorators that # produce valid context managers. -contextmanager-decorators=contextlib.contextmanager +contextmanager-decorators=contextlib.contextmanager,tensorflow.python.util.tf_contextlib.contextmanager [VARIABLES] From 0c20ee4d8546dd905871049825d0883eda491bca Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Sun, 18 Jun 2017 15:00:57 +0100 Subject: [PATCH 12/13] Work around no-name-in-module pylint errors. Following some changes in TF to the `LazyLoader` [1], pylint complains about not being able to find some imports under `tf.contrib`. This looks like a pylint issue, emitting errors like: ************* Module seq2seq.encoders.rnn_encoder E: 24, 0: No name 'rnn' in module 'LazyLoader' (no-name-in-module) ************* Module seq2seq.data.input_pipeline E: 32, 0: No name 'slim' in module 'LazyLoader' (no-name-in-module) [1] https://github.com/tensorflow/tensorflow/commit/95c5d7e880b8b4d18ba1f3b7cf40d15cd218b3c9 --- seq2seq/data/input_pipeline.py | 2 ++ seq2seq/data/parallel_data_provider.py | 2 ++ seq2seq/data/sequence_example_decoder.py | 2 ++ seq2seq/data/split_tokens_decoder.py | 2 ++ seq2seq/encoders/image_encoder.py | 2 ++ seq2seq/encoders/rnn_encoder.py | 3 +-- seq2seq/metrics/metric_specs.py | 2 ++ 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/seq2seq/data/input_pipeline.py b/seq2seq/data/input_pipeline.py index 1d22b5cc..b452adf0 100644 --- a/seq2seq/data/input_pipeline.py +++ b/seq2seq/data/input_pipeline.py @@ -29,7 +29,9 @@ import six import tensorflow as tf +# pylint: disable=no-name-in-module from tensorflow.contrib.slim.python.slim.data import tfexample_decoder +# pylint: enable=no-name-in-module from seq2seq.configurable import Configurable from seq2seq.data import split_tokens_decoder, parallel_data_provider diff --git a/seq2seq/data/parallel_data_provider.py b/seq2seq/data/parallel_data_provider.py index 269add9d..c07046bb 100644 --- a/seq2seq/data/parallel_data_provider.py +++ b/seq2seq/data/parallel_data_provider.py @@ -22,8 +22,10 @@ import numpy as np import tensorflow as tf +# pylint: disable=no-name-in-module from tensorflow.contrib.slim.python.slim.data import data_provider from tensorflow.contrib.slim.python.slim.data import parallel_reader +# pylint: enable=no-name-in-module from seq2seq.data import split_tokens_decoder diff --git a/seq2seq/data/sequence_example_decoder.py b/seq2seq/data/sequence_example_decoder.py index 6eb76181..cc286c5d 100644 --- a/seq2seq/data/sequence_example_decoder.py +++ b/seq2seq/data/sequence_example_decoder.py @@ -14,7 +14,9 @@ """A decoder for tf.SequenceExample""" import tensorflow as tf +# pylint: disable=no-name-in-module from tensorflow.contrib.slim.python.slim.data import data_decoder +# pylint: enable=no-name-in-module class TFSEquenceExampleDecoder(data_decoder.DataDecoder): diff --git a/seq2seq/data/split_tokens_decoder.py b/seq2seq/data/split_tokens_decoder.py index c6c1efe2..2dd04200 100644 --- a/seq2seq/data/split_tokens_decoder.py +++ b/seq2seq/data/split_tokens_decoder.py @@ -21,7 +21,9 @@ from __future__ import unicode_literals import tensorflow as tf +# pylint: disable=no-name-in-module from tensorflow.contrib.slim.python.slim.data import data_decoder +# pylint: enable=no-name-in-module class SplitTokensDecoder(data_decoder.DataDecoder): diff --git a/seq2seq/encoders/image_encoder.py b/seq2seq/encoders/image_encoder.py index f8dac5d8..b8edebbe 100644 --- a/seq2seq/encoders/image_encoder.py +++ b/seq2seq/encoders/image_encoder.py @@ -20,8 +20,10 @@ from __future__ import print_function import tensorflow as tf +# pylint: disable=no-name-in-module from tensorflow.contrib.slim.python.slim.nets.inception_v3 \ import inception_v3_base +# pylint: enable=no-name-in-module from seq2seq.encoders.encoder import Encoder, EncoderOutput diff --git a/seq2seq/encoders/rnn_encoder.py b/seq2seq/encoders/rnn_encoder.py index d21338df..2cbf4a24 100644 --- a/seq2seq/encoders/rnn_encoder.py +++ b/seq2seq/encoders/rnn_encoder.py @@ -21,7 +21,6 @@ import copy import tensorflow as tf -from tensorflow.contrib.rnn.python.ops import rnn from seq2seq.encoders.encoder import Encoder, EncoderOutput from seq2seq.training import utils as training_utils @@ -186,7 +185,7 @@ def encode(self, inputs, sequence_length, **kwargs): cells_fw = _unpack_cell(cell_fw) cells_bw = _unpack_cell(cell_bw) - result = rnn.stack_bidirectional_dynamic_rnn( + result = tf.contrib.rnn.stack_bidirectional_dynamic_rnn( cells_fw=cells_fw, cells_bw=cells_bw, inputs=inputs, diff --git a/seq2seq/metrics/metric_specs.py b/seq2seq/metrics/metric_specs.py index e4c4ceaa..c6da8709 100644 --- a/seq2seq/metrics/metric_specs.py +++ b/seq2seq/metrics/metric_specs.py @@ -28,7 +28,9 @@ import tensorflow as tf from tensorflow.contrib import metrics +# pylint: disable=no-name-in-module from tensorflow.contrib.learn import MetricSpec +# pylint: enable=no-name-in-module from seq2seq.data import postproc from seq2seq.configurable import Configurable From 3aabe479aa753ed2ae441517542234fac01439e8 Mon Sep 17 00:00:00 2001 From: ReDeiPirati Date: Sun, 18 Jun 2017 22:00:45 +0200 Subject: [PATCH 13/13] Fix typo --- docs/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index fe7f3cc8..d8971878 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -21,7 +21,7 @@ First of all you have to build the image for running tf-seq2seq, according to yo * [Docker for Python 2.7](https://github.com/google/seq2seq/seq2seq/tools/docker/py27) * [Docker for Python 3.5](https://github.com/google/seq2seq/seq2seq/tools/docker/py35) -Both the directory have Dockerfile to build image with basic depenecies(Dockerfile), development dependecies(Dockerfile.devel) and GPU support(Dockerfile.gpu and Dockerfile.devel-gpu). The file provided, are coded from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) with **latest** TensorFlow version/tags. +Both the directories have Dockerfile to build image with basic depenecies(Dockerfile), development dependecies(Dockerfile.devel) and GPU support(Dockerfile.gpu and Dockerfile.devel-gpu). The file provided, are coded from the [official TensorFlow Docker directory](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md) with **latest** TensorFlow version/tags. Now you are ready to build the image(you have to be in py27 or py35 dir to run this command): ```bash