0
在inception/inception_eval.py,我想打印標籤和logits。如何打印tensorflow張量
我嘗試了一些方法,但他們不工作。
我怎樣才能得到這些張量的數量?
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())
我已經解決了這個問題。 https://github.com/Youngkl0726/Inception/blob/master/inception/inception_eval.py這是解決方案。 – youngkl