"torchvision/vscode:/vscode.git/clone" did not exist on "cd12b9a9c0c9877e50609f2c46566dab7354f5d4"
Unverified Commit 27bd23e5 authored by Leandro Schelb's avatar Leandro Schelb Committed by GitHub
Browse files

Fixed deprecated tf.contrib.metrics (#9916)

* Fixed deprecated tf.flags

* Fixed deprecated tf.contrib.metrics
parent bdca62cc
......@@ -46,7 +46,7 @@ def char_accuracy(predictions, targets, rej_char, streaming=False):
correct_chars, weights), axis=1),
tf.reduce_sum(input_tensor=weights, axis=1))
if streaming:
return tf.contrib.metrics.streaming_mean(accuracy_per_example)
return tf.metrics.mean(accuracy_per_example)
else:
return tf.reduce_mean(input_tensor=accuracy_per_example)
......@@ -87,6 +87,6 @@ def sequence_accuracy(predictions, targets, rej_char, streaming=False):
accuracy_per_example = tf.cast(
tf.equal(correct_chars_counts, target_chars_counts), dtype=tf.float32)
if streaming:
return tf.contrib.metrics.streaming_mean(accuracy_per_example)
return tf.metrics.mean(accuracy_per_example)
else:
return tf.reduce_mean(input_tensor=accuracy_per_example)
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