浏览代码

Fix rnn translate in python3

Neal Wu 8 年之前
父节点
当前提交
b75faf5a48
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      tutorials/rnn/README.md
  2. 1 1
      tutorials/rnn/translate/data_utils.py

+ 2 - 2
tutorials/rnn/README.md

@@ -2,8 +2,8 @@ This directory contains functions for creating recurrent neural networks
 and sequence-to-sequence models. Detailed instructions on how to get started
 and use them are available in the tutorials.
 
-* [RNN Tutorial](http://tensorflow.org/tutorials/recurrent/index.md)
-* [Sequence-to-Sequence Tutorial](http://tensorflow.org/tutorials/seq2seq/index.md)
+* [RNN Tutorial](http://tensorflow.org/tutorials/recurrent/)
+* [Sequence-to-Sequence Tutorial](http://tensorflow.org/tutorials/seq2seq/)
 
 Here is a short overview of what is in this directory.
 

+ 1 - 1
tutorials/rnn/translate/data_utils.py

@@ -177,7 +177,7 @@ def initialize_vocabulary(vocabulary_path):
     rev_vocab = []
     with gfile.GFile(vocabulary_path, mode="rb") as f:
       rev_vocab.extend(f.readlines())
-    rev_vocab = [line.strip() for line in rev_vocab]
+    rev_vocab = [tf.compat.as_bytes(line.strip()) for line in rev_vocab]
     vocab = dict([(x, y) for (y, x) in enumerate(rev_vocab)])
     return vocab, rev_vocab
   else: