Commit bc86a539 authored by Toby Boyd's avatar Toby Boyd Committed by GitHub
Browse files

Merge pull request #2259 from skwbc/str_decode_py3

bugfix for rnn tutorial on Python3
parents 55e6e387 812bc2e7
......@@ -25,9 +25,13 @@ import sys
import tensorflow as tf
Py3 = sys.version_info[0] == 3
def _read_words(filename):
with tf.gfile.GFile(filename, "r") as f:
if Py3:
return f.read().replace("\n", "<eos>").split()
else:
return f.read().decode("utf-8").replace("\n", "<eos>").split()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment