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
7922c9eb
Unverified
Commit
7922c9eb
authored
Jul 23, 2018
by
Asim Shankar
Committed by
GitHub
Jul 23, 2018
Browse files
Merge pull request #4853 from tensorflow/mnist_metrics_dtype
Use float32 metrics in mnist_eager
parents
05ec6d87
dfafba4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/mnist/mnist_eager.py
official/mnist/mnist_eager.py
+2
-2
No files found.
official/mnist/mnist_eager.py
View file @
7922c9eb
...
@@ -83,8 +83,8 @@ def train(model, optimizer, dataset, step_counter, log_interval=None):
...
@@ -83,8 +83,8 @@ def train(model, optimizer, dataset, step_counter, log_interval=None):
def
test
(
model
,
dataset
):
def
test
(
model
,
dataset
):
"""Perform an evaluation of `model` on the examples from `dataset`."""
"""Perform an evaluation of `model` on the examples from `dataset`."""
avg_loss
=
tfe
.
metrics
.
Mean
(
'loss'
)
avg_loss
=
tfe
.
metrics
.
Mean
(
'loss'
,
dtype
=
tf
.
float32
)
accuracy
=
tfe
.
metrics
.
Accuracy
(
'accuracy'
)
accuracy
=
tfe
.
metrics
.
Accuracy
(
'accuracy'
,
dtype
=
tf
.
float32
)
for
(
images
,
labels
)
in
dataset
:
for
(
images
,
labels
)
in
dataset
:
logits
=
model
(
images
,
training
=
False
)
logits
=
model
(
images
,
training
=
False
)
...
...
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