1

I have a variable naming decoder. At the beginning it is a python array. Then it is assigned to a tensor for further computation and after the computation is done, I want to see the real value of this array again. How is it possible?
By writing tf.Print(value) or print(value) I get something like below:

<tf.Tensor 'decoder1:0' shape=(?,) dtype=int32>    

And also by writing tf.get_variable("decoder1:0",0) I get this at the console: tensorflow.python.ops.variables.Variable object at 0x7fe5000deb50>

How can I see the inside value of this variable?

p.s. I also have seen other posts in SO like this one: TensorFlow - get current value of a Variable and etc. but none helped me out.

Thanks in advance

Paniz
  • 594
  • 6
  • 19

1 Answers1

4

You need to evaluate the tensor variable:

p_value = sess.run(value)

If you have a default session:

p_value = value.eval()
Sung Kim
  • 8,417
  • 9
  • 34
  • 42