Skip to content

Commit 27bd23e

Browse files
Fixed deprecated tf.contrib.metrics (tensorflow#9916)
* Fixed deprecated tf.flags * Fixed deprecated tf.contrib.metrics
1 parent bdca62c commit 27bd23e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

research/attention_ocr/python/metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def char_accuracy(predictions, targets, rej_char, streaming=False):
4646
correct_chars, weights), axis=1),
4747
tf.reduce_sum(input_tensor=weights, axis=1))
4848
if streaming:
49-
return tf.contrib.metrics.streaming_mean(accuracy_per_example)
49+
return tf.metrics.mean(accuracy_per_example)
5050
else:
5151
return tf.reduce_mean(input_tensor=accuracy_per_example)
5252

@@ -87,6 +87,6 @@ def sequence_accuracy(predictions, targets, rej_char, streaming=False):
8787
accuracy_per_example = tf.cast(
8888
tf.equal(correct_chars_counts, target_chars_counts), dtype=tf.float32)
8989
if streaming:
90-
return tf.contrib.metrics.streaming_mean(accuracy_per_example)
90+
return tf.metrics.mean(accuracy_per_example)
9191
else:
9292
return tf.reduce_mean(input_tensor=accuracy_per_example)

0 commit comments

Comments
 (0)