我正在Tensorflow中使用CNN进行图像分割。我知道如何计算训练精度

 #compute the accuracy
    correct_prediction  = tf.equal(tf.argmax(flat_logits, 1), tf.argmax(y,1))
    accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))



[train_accuracy] = sess.run([accuracy], feed_dict={x: batch_x, y:batch_y})


是否可以计算每个测试图像的准确性?

最佳答案

对的,这是可能的。您只需编写以下代码即可:

test_accuracy = sess.run(accuracy, feed_dict={x: x_test, y:y_test})


其中x_test是您的单个测试图像(例如,尺寸[1,宽度,高度,深度],而y_test是相应的输出。

关于tensorflow - 获取图像分割中单个测试图像的准确性,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50385327/

10-11 22:03
查看更多