问题
Whenever I try printing I always get truncated results
import tensorflow as tf
import numpy as np
np.set_printoptions(threshold=np.nan)
tensor = tf.constant(np.ones(999))
tensor = tf.Print(tensor, [tensor])
sess = tf.Session()
sess.run(tensor)
As you can see I've followed a guide I found on Print full value of tensor into console or write to file in tensorflow
But the output is simply
...\core\kernels\logging_ops.cc:79] [1 1 1...]
I want to see the full tensor, thanks.
回答1:
This is solved easily by checking the Tensorflow API for tf.Print
. Pass summarize=n
where n
is the number of elements you want displayed.
来源:https://stackoverflow.com/questions/49429733/how-to-print-full-not-truncated-tensor-in-tensorflow