diff options
author | Akshay Modi <nareshmodi@google.com> | 2018-06-18 11:48:36 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-06-18 11:55:03 -0700 |
commit | 148b4381fd0259cae441e459ec8ebe2c5d557722 (patch) | |
tree | c66c96ea6c60c63385b528dce195af802b8acf3b /tensorflow/contrib/slim | |
parent | fc03fbff3dd7a58fa4f16226df4ada1f21f8b53f (diff) |
Automated g4 rollback of changelist 201011811
PiperOrigin-RevId: 201033171
Diffstat (limited to 'tensorflow/contrib/slim')
-rw-r--r-- | tensorflow/contrib/slim/python/slim/evaluation_test.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tensorflow/contrib/slim/python/slim/evaluation_test.py b/tensorflow/contrib/slim/python/slim/evaluation_test.py index 3d0308aaf3..94fc12ca81 100644 --- a/tensorflow/contrib/slim/python/slim/evaluation_test.py +++ b/tensorflow/contrib/slim/python/slim/evaluation_test.py @@ -26,6 +26,7 @@ import time import numpy as np from tensorflow.contrib.framework.python.ops import variables as variables_lib +from tensorflow.contrib.metrics.python.ops import metric_ops from tensorflow.contrib.slim.python.slim import evaluation from tensorflow.contrib.training.python.training import evaluation as evaluation_lib from tensorflow.core.protobuf import saver_pb2 @@ -36,7 +37,6 @@ from tensorflow.python.framework import dtypes from tensorflow.python.framework import errors from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import math_ops -from tensorflow.python.ops import metrics from tensorflow.python.ops import variables from tensorflow.python.platform import flags from tensorflow.python.platform import gfile @@ -89,8 +89,8 @@ class EvaluationTest(test.TestCase): self._predictions, self._scale = TestModel(self._inputs) def testFinalOpsOnEvaluationLoop(self): - value_op, update_op = metrics.accuracy( - labels=self._labels, predictions=self._predictions) + value_op, update_op = metric_ops.streaming_accuracy(self._predictions, + self._labels) init_op = control_flow_ops.group(variables.global_variables_initializer(), variables.local_variables_initializer()) # Create checkpoint and log directories: @@ -136,10 +136,9 @@ class EvaluationTest(test.TestCase): self.assertTrue(obj.hook_was_run) def _create_names_to_metrics(self, predictions, labels): - accuracy0, update_op0 = metrics.accuracy( - labels=labels, predictions=predictions) - accuracy1, update_op1 = metrics.accuracy( - labels=labels, predictions=predictions + 1) + accuracy0, update_op0 = metric_ops.streaming_accuracy(predictions, labels) + accuracy1, update_op1 = metric_ops.streaming_accuracy(predictions + 1, + labels) names_to_values = {'Accuracy': accuracy0, 'Another_accuracy': accuracy1} names_to_updates = {'Accuracy': update_op0, 'Another_accuracy': update_op1} @@ -199,8 +198,8 @@ class EvaluationTest(test.TestCase): predictions_limited = input.limit_epochs(self._predictions, num_epochs=1) labels_limited = input.limit_epochs(self._labels, num_epochs=1) - value_op, update_op = metrics.accuracy( - labels=labels_limited, predictions=predictions_limited) + value_op, update_op = metric_ops.streaming_accuracy( + predictions_limited, labels_limited) init_op = control_flow_ops.group(variables.global_variables_initializer(), variables.local_variables_initializer()) @@ -261,8 +260,8 @@ class SingleEvaluationTest(test.TestCase): self._prepareCheckpoint(checkpoint_path) # Next, determine the metric to evaluate: - value_op, update_op = metrics.accuracy( - labels=self._labels, predictions=self._predictions) + value_op, update_op = metric_ops.streaming_accuracy(self._predictions, + self._labels) # Run the evaluation and verify the results: accuracy_value = evaluation.evaluate_once( @@ -277,8 +276,8 @@ class SingleEvaluationTest(test.TestCase): self._prepareCheckpoint(checkpoint_path) # Next, determine the metric to evaluate: - value_op, update_op = metrics.accuracy( - labels=self._labels, predictions=self._predictions) + value_op, update_op = metric_ops.streaming_accuracy(self._predictions, + self._labels) dumping_root = os.path.join(self.get_temp_dir(), 'tfdbg_dump_dir') dumping_hook = hooks.DumpingDebugHook(dumping_root, log_usage=False) |