Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
812bc2e7
Commit
812bc2e7
authored
Aug 19, 2017
by
Shota Kawabuchi
Browse files
bugfix for rnn tutorial on Python3
parent
70097a35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
tutorials/rnn/ptb/reader.py
tutorials/rnn/ptb/reader.py
+5
-1
No files found.
tutorials/rnn/ptb/reader.py
View file @
812bc2e7
...
...
@@ -25,10 +25,14 @@ import sys
import
tensorflow
as
tf
Py3
=
sys
.
version_info
[
0
]
==
3
def
_read_words
(
filename
):
with
tf
.
gfile
.
GFile
(
filename
,
"r"
)
as
f
:
return
f
.
read
().
decode
(
"utf-8"
).
replace
(
"
\n
"
,
"<eos>"
).
split
()
if
Py3
:
return
f
.
read
().
replace
(
"
\n
"
,
"<eos>"
).
split
()
else
:
return
f
.
read
().
decode
(
"utf-8"
).
replace
(
"
\n
"
,
"<eos>"
).
split
()
def
_build_vocab
(
filename
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment