简体   繁体   中英

How to see the output after each layer of CNN in tensor flow using PYCHARM IDE?

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: 在此处输入图像描述

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM