tf.metrics.accuracy ==>坑货

tf.metrics.accuracy输出两个值,第一个值为上几步的平均精度,第二值是上几步与该步的精度的平均值.

   

正常的计算单个batch正确率的代码

self.correct_prediction = tf.equal(self.labels,self.labels_pred )
self.accuracy = tf.reduce_mean(tf.cast(self.correct_prediction, tf.float32))

   

   

   

posted @ 2019-01-18 10:38  simple_wxl  阅读(1739)  评论(0编辑  收藏  举报