2017-04-20 109 views

回答

1

您需要執行此操作才能收集樣本並建立統計。

直接從the docs

labels = ... 
predictions = ... 
accuracy, update_op_acc = tf.contrib.metrics.streaming_accuracy(
    labels, predictions) 
error, update_op_error = tf.contrib.metrics.streaming_mean_absolute_error(
    labels, predictions) 

sess.run(tf.local_variables_initializer()) 
for batch in range(num_batches): 
    sess.run([update_op_acc, update_op_error]) 

accuracy, mean_absolute_error = sess.run([accuracy, mean_absolute_error])