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
fda7e6dc
Commit
fda7e6dc
authored
Oct 18, 2017
by
Andrew M. Dai
Browse files
Fix frequent deadlocks caused by summaries not depending on the save_state ops.
PiperOrigin-RevId: 172665358
parent
4b5a0801
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
research/adversarial_text/graphs.py
research/adversarial_text/graphs.py
+3
-4
No files found.
research/adversarial_text/graphs.py
View file @
fda7e6dc
...
...
@@ -189,11 +189,10 @@ class VatxtModel(object):
tf
.
summary
.
scalar
(
'adversarial_loss'
,
adv_loss
)
total_loss
=
loss
+
adv_loss
tf
.
summary
.
scalar
(
'total_classification_loss'
,
total_loss
)
with
tf
.
control_dependencies
([
inputs
.
save_state
(
next_state
)]):
total_loss
=
tf
.
identity
(
total_loss
)
tf
.
summary
.
scalar
(
'total_classification_loss'
,
total_loss
)
return
total_loss
def
language_model_graph
(
self
,
compute_loss
=
True
):
...
...
@@ -419,12 +418,12 @@ class VatxtBidirModel(VatxtModel):
tf
.
summary
.
scalar
(
'adversarial_loss'
,
adv_loss
)
total_loss
=
loss
+
adv_loss
tf
.
summary
.
scalar
(
'total_classification_loss'
,
total_loss
)
saves
=
[
inp
.
save_state
(
state
)
for
(
inp
,
state
)
in
zip
(
inputs
,
next_states
)]
with
tf
.
control_dependencies
(
saves
):
total_loss
=
tf
.
identity
(
total_loss
)
tf
.
summary
.
scalar
(
'total_classification_loss'
,
total_loss
)
return
total_loss
def
language_model_graph
(
self
,
compute_loss
=
True
):
...
...
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