提交 2c033b7b 编写于 作者: J Jesper Steen Møller 提交者: Martin Wicke

Work on strings instead of binary in Python3 (#2622)

上级 77da9d07
......@@ -51,7 +51,7 @@ filename = maybe_download('text8.zip', 31344016)
def read_data(filename):
"""Extract the first file enclosed in a zip file as a list of words"""
with zipfile.ZipFile(filename) as f:
data = f.read(f.namelist()[0]).split()
data = tf.compat.as_str(f.read(f.namelist()[0])).split()
return data
words = read_data(filename)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册