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
7498acc6
Commit
7498acc6
authored
Oct 17, 2016
by
Xin Pan
Committed by
GitHub
Oct 17, 2016
Browse files
Merge pull request #377 from kaiix/textsum-multigpu
Fix run textsum on a single GPU
parents
0f904081
a0de5ca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
textsum/seq2seq_attention.py
textsum/seq2seq_attention.py
+2
-1
textsum/seq2seq_attention_model.py
textsum/seq2seq_attention_model.py
+2
-1
No files found.
textsum/seq2seq_attention.py
View file @
7498acc6
...
...
@@ -94,7 +94,8 @@ def _Train(model, data_batcher):
save_summaries_secs
=
60
,
save_model_secs
=
FLAGS
.
checkpoint_secs
,
global_step
=
model
.
global_step
)
sess
=
sv
.
prepare_or_wait_for_session
()
sess
=
sv
.
prepare_or_wait_for_session
(
config
=
tf
.
ConfigProto
(
allow_soft_placement
=
True
))
running_avg_loss
=
0
step
=
0
while
not
sv
.
should_stop
()
and
step
<
FLAGS
.
max_run_steps
:
...
...
textsum/seq2seq_attention_model.py
View file @
7498acc6
...
...
@@ -105,7 +105,8 @@ class Seq2SeqAttentionModel(object):
if
self
.
_num_gpus
==
0
:
return
''
dev
=
'/gpu:%d'
%
self
.
_cur_gpu
self
.
_cur_gpu
=
(
self
.
_cur_gpu
+
1
)
%
(
self
.
_num_gpus
-
1
)
if
self
.
_num_gpus
>
1
:
self
.
_cur_gpu
=
(
self
.
_cur_gpu
+
1
)
%
(
self
.
_num_gpus
-
1
)
return
dev
def
_get_gpu
(
self
,
gpu_id
):
...
...
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