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
50257111
Commit
50257111
authored
Oct 11, 2017
by
Greg Price
Committed by
Neal Wu
Oct 11, 2017
Browse files
tutorials/rnn/ptb: Small fix to make Python 3-compatible. (#2403)
parent
66d20d87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tutorials/rnn/ptb/ptb_word_lm.py
tutorials/rnn/ptb/ptb_word_lm.py
+2
-2
No files found.
tutorials/rnn/ptb/ptb_word_lm.py
View file @
50257111
...
@@ -252,7 +252,7 @@ class PTBModel(object):
...
@@ -252,7 +252,7 @@ class PTBModel(object):
ops
.
update
(
lr
=
self
.
_lr
,
new_lr
=
self
.
_new_lr
,
lr_update
=
self
.
_lr_update
)
ops
.
update
(
lr
=
self
.
_lr
,
new_lr
=
self
.
_new_lr
,
lr_update
=
self
.
_lr_update
)
if
self
.
_rnn_params
:
if
self
.
_rnn_params
:
ops
.
update
(
rnn_params
=
self
.
_rnn_params
)
ops
.
update
(
rnn_params
=
self
.
_rnn_params
)
for
name
,
op
in
ops
.
iter
items
():
for
name
,
op
in
ops
.
items
():
tf
.
add_to_collection
(
name
,
op
)
tf
.
add_to_collection
(
name
,
op
)
self
.
_initial_state_name
=
util
.
with_prefix
(
self
.
_name
,
"initial"
)
self
.
_initial_state_name
=
util
.
with_prefix
(
self
.
_name
,
"initial"
)
self
.
_final_state_name
=
util
.
with_prefix
(
self
.
_name
,
"final"
)
self
.
_final_state_name
=
util
.
with_prefix
(
self
.
_name
,
"final"
)
...
@@ -484,7 +484,7 @@ def main(_):
...
@@ -484,7 +484,7 @@ def main(_):
input_
=
test_input
)
input_
=
test_input
)
models
=
{
"Train"
:
m
,
"Valid"
:
mvalid
,
"Test"
:
mtest
}
models
=
{
"Train"
:
m
,
"Valid"
:
mvalid
,
"Test"
:
mtest
}
for
name
,
model
in
models
.
iter
items
():
for
name
,
model
in
models
.
items
():
model
.
export_ops
(
name
)
model
.
export_ops
(
name
)
metagraph
=
tf
.
train
.
export_meta_graph
()
metagraph
=
tf
.
train
.
export_meta_graph
()
if
tf
.
__version__
<
"1.1.0"
and
FLAGS
.
num_gpus
>
1
:
if
tf
.
__version__
<
"1.1.0"
and
FLAGS
.
num_gpus
>
1
:
...
...
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