我在 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/