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
b75faf5a
Commit
b75faf5a
authored
Dec 27, 2016
by
Neal Wu
Browse files
Fix rnn translate in python3
parent
07827aab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
tutorials/rnn/README.md
tutorials/rnn/README.md
+2
-2
tutorials/rnn/translate/data_utils.py
tutorials/rnn/translate/data_utils.py
+1
-1
No files found.
tutorials/rnn/README.md
View file @
b75faf5a
...
@@ -2,8 +2,8 @@ This directory contains functions for creating recurrent neural networks
...
@@ -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 sequence-to-sequence models. Detailed instructions on how to get started
and use them are available in the tutorials.
and use them are available in the tutorials.
*
[
RNN Tutorial
](
http://tensorflow.org/tutorials/recurrent/
index.md
)
*
[
RNN Tutorial
](
http://tensorflow.org/tutorials/recurrent/
)
*
[
Sequence-to-Sequence Tutorial
](
http://tensorflow.org/tutorials/seq2seq/
index.md
)
*
[
Sequence-to-Sequence Tutorial
](
http://tensorflow.org/tutorials/seq2seq/
)
Here is a short overview of what is in this directory.
Here is a short overview of what is in this directory.
...
...
tutorials/rnn/translate/data_utils.py
View file @
b75faf5a
...
@@ -177,7 +177,7 @@ def initialize_vocabulary(vocabulary_path):
...
@@ -177,7 +177,7 @@ def initialize_vocabulary(vocabulary_path):
rev_vocab
=
[]
rev_vocab
=
[]
with
gfile
.
GFile
(
vocabulary_path
,
mode
=
"rb"
)
as
f
:
with
gfile
.
GFile
(
vocabulary_path
,
mode
=
"rb"
)
as
f
:
rev_vocab
.
extend
(
f
.
readlines
())
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
)])
vocab
=
dict
([(
x
,
y
)
for
(
y
,
x
)
in
enumerate
(
rev_vocab
)])
return
vocab
,
rev_vocab
return
vocab
,
rev_vocab
else
:
else
:
...
...
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