Commit a88b89be authored by Sundara Tejaswi Digumarti's avatar Sundara Tejaswi Digumarti Committed by Taylor Robie
Browse files

Compute metrics under distributed strategies. (#4942)

Removed the conditional over distributed strategies when computing metrics.
Metrics are now computed even when distributed strategies are used.
parent 887bbcb9
...@@ -300,12 +300,7 @@ def resnet_model_fn(features, labels, mode, model_class, ...@@ -300,12 +300,7 @@ def resnet_model_fn(features, labels, mode, model_class,
else: else:
train_op = None train_op = None
if not tf.contrib.distribute.has_distribution_strategy(): accuracy = tf.metrics.accuracy(labels, predictions['classes'])
accuracy = tf.metrics.accuracy(labels, predictions['classes'])
else:
# Metrics are currently not compatible with distribution strategies during
# training. This does not affect the overall performance of the model.
accuracy = (tf.no_op(), tf.constant(0))
metrics = {'accuracy': accuracy} metrics = {'accuracy': accuracy}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment