I am using Tensor Flow's retraining example on my own dataset. The final test evaluation outputs the final test accuracy and the names of the misclassified images:
test_accuracy, predictions = eval_session.run(
[evaluation_step, prediction],
feed_dict={
bottleneck_input: test_bottlenecks,
ground_truth_input: test_ground_truth
})
tf.logging.info('Final test accuracy = %.1f%% (N=%d)' %
(test_accuracy * 100, len(test_bottlenecks)))
if FLAGS.print_misclassified_test_images:
tf.logging.info('=== MISCLASSIFIED TEST IMAGES ===')
for i, test_filename in enumerate(test_filenames):
if predictions[i] != test_ground_truth[i]:
tf.logging.info('%70s %s' % (test_filename, list(image_lists.keys())[predictions[i]]))
How can I also print the probabilities associated to the predictions for all classes?
For example:
image1 - A: 0.5; B: 0.3; C: 0.1; D: 0.1
image2 - A: 0.3; B: 0.2; C: 0:4; D: 0.1