Commit 286bacf2 authored by ngovanmao's avatar ngovanmao
Browse files

Fix a small bug of Python3 compatibility in tutorial example /rnn/ptb

parent 62b33958
......@@ -21,12 +21,16 @@ from __future__ import print_function
import collections
import os
import sys
import tensorflow as tf
def _read_words(filename):
with tf.gfile.GFile(filename, "r") as f:
if sys.version_info[0] >= 3:
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