0

In inception/inception_eval.py, I want to print the label and logits.

I have tried some methods but they don't work.
How can I get the number of these tensors?

  with tf.Graph().as_default():
# Get images and labels from the dataset.

# with tf.Session() as sess:
#   images, labels = image_processing.inputs(dataset)
#   print ("lable")
#   sess.run (labels.eval())
images, labels = image_processing.inputs(dataset)
# sess = tf.Session()
# print("lable")
# print (labels)
# Number of classes in the Dataset label set plus 1.
# Label 0 is reserved for an (unused) background class.
num_classes = dataset.num_classes() + 1

# Build a Graph that computes the logits predictions from the
# inference model.
logits, _ = inception.inference(images, num_classes)
print ("logits")
# print (tf.cast(logits,tf.float32).eval())
# print ("_")
# print (tf.cast(_,tf.float32).eval())
youngkl
  • 1
  • 1
  • This question I have solved. https://github.com/Youngkl0726/Inception/blob/master/inception/inception_eval.py This is the solution. – youngkl Jun 12 '17 at 09:07

1 Answers1

0

If you will check the inception_model file, you will see that the inference function returns you two tensors:

Logits. 2-D float Tensor.

Auxiliary Logits. 2-D float Tensor of side-head. Used for training only.

So you just need to create a session and run this tensor inside of this session.

Salvador Dali
  • 214,103
  • 147
  • 703
  • 753