Repository: tensorflow/tensor2tensor

Issue:
Error with `.decode` on `str` object when generating  `summarize_cnn_dailymail32k` data
## CMD
```
t2t-trainer \
  --generate_data \
  --data_dir="$data" \
  --problems=summarize_cnn_dailymail32k \
  --model=transformer \
  --hparams_set=transformer_base_single_gpu \
  --output_dir="$root"
```

## OUTPUT
```
INFO:tensorflow:Generating data for summarize_cnn_dailymail32k
INFO:tensorflow:Generating vocab file: t2t_data/vocab.cnndailymail.32768
INFO:tensorflow:Downloading https://drive.google.com/uc?export=download&id=0BwmD_VLjROrfTHk4NFg2SndKcjQ&confirm=ak1U to /tmp/t2t_datagen/cnn_stories.tgz

INFO:tensorflow:Succesfully downloaded cnn_stories.tgz, 158577824 bytes.
INFO:tensorflow:Downloading https://drive.google.com/uc?export=download&id=0BwmD_VLjROrfM1BxdkxVaTY2bWs&confirm=1N53 to /tmp/t2t_datagen/dailymail_stories.tgz

INFO:tensorflow:Succesfully downloaded dailymail_stories.tgz, 375893739 bytes.
Traceback (most recent call last):
  File "/home/pltrdy/anaconda3/bin/t2t-trainer", line 96, in <module>
    tf.app.run()
  File "/home/pltrdy/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/pltrdy/anaconda3/bin/t2t-trainer", line 83, in main
    problem.generate_data(data_dir, tmp_dir)
  File "/home/pltrdy/anaconda3/lib/python3.6/site-packages/tensor2tensor/data_generators/problem.py", line 625, in generate_data
    self.generator(data_dir, tmp_dir, True), all_paths)
  File "/home/pltrdy/anaconda3/lib/python3.6/site-packages/tensor2tensor/data_generators/generator_utils.py", line 143, in generate_files
    for case in generator:
  File "/home/pltrdy/anaconda3/lib/python3.6/site-packages/tensor2tensor/data_generators/cnn_dailymail.py", line 132, in generator
    story_generator(tmp_dir))
  File "/home/pltrdy/anaconda3/lib/python3.6/site-packages/tensor2tensor/data_generators/generator_utils.py", line 328, in get_or_generate_vocab_inner
    for item in generator:
  File "/home/pltrdy/anaconda3/lib/python3.6/site-packages/tensor2tensor/data_generators/cnn_dailymail.py", line 78, in story_generator
    line = unicode(line, "utf-8") if six.PY2 else line.decode("utf-8")
AttributeError: 'str' object has no attribute 'decode'
```

## CONFIG
* Python version: `Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:09:58)`
* Tensor2Tensor version:
```
$ pip show tensor2tensor
Name: tensor2tensor
Version: 1.2.4
Summary: Tensor2Tensor
Home-page: http://github.com/tensorflow/tensor2tensor
Author: Google Inc.
Author-email: no-reply@google.com
License: Apache 2.0
Location: /home/pltrdy/anaconda3/lib/python3.6/site-packages
Requires: sympy, numpy, requests, six, future, bz2file
```

## QUICKFIX
```
--- a/tensor2tensor/data_generators/cnn_dailymail.py
+++ b/tensor2tensor/data_generators/cnn_dailymail.py
@@ -74,7 +74,7 @@ def story_generator(tmp_dir):
   for path in paths:
     for story_file in tf.gfile.Glob(path + "*"):
       story = u""
-      for line in tf.gfile.Open(story_file):
+      for line in tf.gfile.Open(story_file, 'rb'):

```


Discussion:

Resolving patch:
diff --git a/tensor2tensor/data_generators/cnn_dailymail.py b/tensor2tensor/data_generators/cnn_dailymail.py
--- a/tensor2tensor/data_generators/cnn_dailymail.py
+++ b/tensor2tensor/data_generators/cnn_dailymail.py
@@ -74,7 +74,7 @@ def story_generator(tmp_dir):
   for path in paths:
     for story_file in tf.gfile.Glob(path + "*"):
       story = u""
-      for line in tf.gfile.Open(story_file):
+      for line in tf.gfile.Open(story_file, 'rb'):
         line = unicode(line, "utf-8") if six.PY2 else line.decode("utf-8")
         story += line
       yield story


Test patch: