Hey I\'m trying to figure out how to get the probabilities for each of the classes in the CIFAR example. Currently I can input the predicted class in the input tensor and get ba
The CIFAR-10 example code for evaluation (in cifar10_eval.py) produces (as an intermediate output) a logits tensor that contains log-probabilities that a given image is in each of the classes. Passing this tensor to sess.run()
will give you the necessary information to tell you what the predicted class for an image is. If instead you compute tf.nn.softmax(logits)
and pass that to sess.run()
, you will get a probability (ranging from 0 to 1) for each class.