0

I am trying to get the value of a full feature matrix.

Here is my simplified code

aTensor is assigned

aTensor = tf.nn.relu(tf.nn.bias_add(tf.nn.conv2d(image1, w, strides=[1,1,1,1], padding='SAME'),b))

Trying to get detailed data obtained by aTensor

print aTensor

I get following

Tensor("Relu_1:0", shape=TensorShape([Dimension(None), Dimension(5), Dimension(5), Dimension(8)]), dtype=float32)

How can I get the values stored in "Dimension(5), Dimension(5), Dimension(8)"?

Many thanks

1 Answers1

0

Well, you need to understand how tensorflow works in order to understand why you have that issue:

  1. First you "build" a graph (imagine you build a chip-layout)
  2. Then (later) you throw data at that graph.

THEN (I guess) you want to see what's actually in there. In order to do that, create an additional print-op in the graph (in step 1 above) that will automatically be executed in step 2.

You can see how tf.print works here: tf.print in the API

Phillip Bock
  • 1,879
  • 14
  • 23