0

I just started to learn python and want to learn CNN implementation on PyCharm. I debugged code but I could not see/visualize the output values of matrices. I only received from this to h_conv1 = tf.nn.relu(conv1d(x_image, W_conv1) + b_conv1) this Tensor("Relu:0", shape=(?, 1, 200, 196), dtype=float32). As for as I know about this output tensor, it is 196 matrices of 1*200 dimensions. However, I want to know the output values came inside these matrices. For a more clear understanding, here is the example as can be seen in the below-given image: enter image description here

We have 6 * 6 * 3, 3 matrices of 6 * 6 and we are applying two filters on each so it leads two matrices of 4*4 dimensions. I would like to see these two matrices values in pycharm by using TensorFlow at the time of debugging?

Nafees Ahmed
  • 93
  • 12
  • Does https://stackoverflow.com/questions/49184548/how-do-i-visualize-or-plot-a-multidimensional-tensor help? – AKX Oct 05 '20 at 06:50
  • @AKX thanks for your comment. But it is multidimensional matrix image visualization and I want to know each matrix values I received after applying CNN. – Nafees Ahmed Oct 05 '20 at 06:54
  • If you can get the tensor data out of TF, https://stackoverflow.com/questions/50897557/how-can-i-view-tensor-as-an-image/50897777 – AKX Oct 05 '20 at 06:56
  • A bit helpful but how can we extract these matrices from here `Tensor("Relu:0", shape=(?, 1, 200, 196), dtype=float32)` ? – Nafees Ahmed Oct 05 '20 at 07:23
  • I do not know what happened to stackoverflow as I am not getting any feedback from this platform. Either my question is too silly or StackOverflow community is sleeping – Nafees Ahmed Oct 06 '20 at 04:51

1 Answers1

1

In the TensorFlow there are two environment to implement the deep model:

1: Eager Execution: Eager execution is a powerful execution environment that evaluates operations immediately. It does not build graphs, and the operations return actual values instead of computational graphs to run later. With Eager execution, TensorFlow calculates the values of tensors as they occur in your code.

2: Graph Execution: Since eager execution runs all operations one-by-one in Python, it cannot take advantage of potential acceleration opportunities. Graph execution extracts tensor computations from Python and builds an efficient graph before evaluation.

Hence, Eager Execution can do your work. Please check further this link: https://towardsdatascience.com/eager-execution-vs-graph-execution-which-is-better-38162ea4dbf6

Ahmad
  • 645
  • 2
  • 6
  • 21