I am trying to get the weight matrix of my hidden_layer2 and print it. It seems like I am able to get the weight matrix, but I am not able to print it.
When using tf.Print(w, [w])
it prints nothing.
When using print(tf.Print(w,[w])
it prints at least the info about the tensor:
Tensor("hidden_layer2_2/Print:0", shape=(3, 2), dtype=float32)
I also tried to use tf.Print()
outside of the with-Statement, same result.
Full code is here, I am just processing random data in a feed-forward NN: https://pastebin.com/KiQUBqK4
A part of my Code:
hidden_layer2 = tf.layers.dense(
inputs=hidden_layer1,
units=2,
activation=tf.nn.relu,
name="hidden_layer2")
with tf.variable_scope("hidden_layer2", reuse=True):
w = tf.get_variable("kernel")
tf.Print(w, [w])
# Also tried tf.Print(hidden_layer2, [w])