title: How can I see the model as visualized?
body: <p>I am trying to do some sample code of <code>GAN</code>, here comes the generator.</p>
  <p>I want to see the visualized model but, this is not the model.</p>
  <p><code>Model.summary()</code> is not the function of <a href="/questions/tagged/tensorflow" class="post-tag" title="show questions tagged &#39;tensorflow&#39;" rel="tag">tensorflow</a> but it is <a href="/questions/tagged/keras" class="post-tag" title="show questions tagged &#39;keras&#39;" rel="tag">keras</a>?? if so how can I see visualized model??</p>
  <pre><code>g_model = generator(input_z, output_channel_dim)
  g_model.summary() // AttributeError: 'Tensor' object has no attribute 'summary'
  </code></pre>
  <p>My function is here.</p>
  <pre><code>def generator(z, output_channel_dim, is_train=True):
  
      with tf.variable_scope(&quot;generator&quot;, reuse= not is_train):
          
          # First FC layer --&gt; 8x8x1024
          fc1 = tf.layers.dense(z, 8*8*1024)
          
          # Reshape it
          fc1 = tf.reshape(fc1, (-1, 8, 8, 1024))
          
          # Leaky ReLU
          fc1 = tf.nn.leaky_relu(fc1, alpha=alpha)
  
          
          # Transposed conv 1 --&gt; BatchNorm --&gt; LeakyReLU
          # 8x8x1024 --&gt; 16x16x512
          trans_conv1 = tf.layers.conv2d_transpose(inputs = fc1,
                                    filters = 512,
                                    kernel_size = [5,5],
                                    strides = [2,2],
                                    padding = &quot;SAME&quot;,
                                  kernel_initializer=tf.truncated_normal_initializer(stddev=0.02),
                                  name=&quot;trans_conv1&quot;)
          
          batch_trans_conv1 = tf.layers.batch_normalization(inputs = trans_conv1, training=is_train, epsilon=1e-5, name=&quot;batch_trans_conv1&quot;)
         
          trans_conv1_out = tf.nn.leaky_relu(batch_trans_conv1, alpha=alpha, name=&quot;trans_conv1_out&quot;)
          
          
          # Transposed conv 2 --&gt; BatchNorm --&gt; LeakyReLU
          # 16x16x512 --&gt; 32x32x256
          trans_conv2 = tf.layers.conv2d_transpose(inputs = trans_conv1_out,
                                    filters = 256,
                                    kernel_size = [5,5],
                                    strides = [2,2],
                                    padding = &quot;SAME&quot;,
                                  kernel_initializer=tf.truncated_normal_initializer(stddev=0.02),
                                  name=&quot;trans_conv2&quot;)
          
          batch_trans_conv2 = tf.layers.batch_normalization(inputs = trans_conv2, training=is_train, epsilon=1e-5, name=&quot;batch_trans_conv2&quot;)
         
          trans_conv2_out = tf.nn.leaky_relu(batch_trans_conv2, alpha=alpha, name=&quot;trans_conv2_out&quot;)
          
          
          # Transposed conv 3 --&gt; BatchNorm --&gt; LeakyReLU
          # 32x32x256 --&gt; 64x64x128
          trans_conv3 = tf.layers.conv2d_transpose(inputs = trans_conv2_out,
                                    filters = 128,
                                    kernel_size = [5,5],
                                    strides = [2,2],
                                    padding = &quot;SAME&quot;,
                                  kernel_initializer=tf.truncated_normal_initializer(stddev=0.02),
                                  name=&quot;trans_conv3&quot;)
          
          batch_trans_conv3 = tf.layers.batch_normalization(inputs = trans_conv3, training=is_train, epsilon=1e-5, name=&quot;batch_trans_conv3&quot;)
         
          trans_conv3_out = tf.nn.leaky_relu(batch_trans_conv3, alpha=alpha, name=&quot;trans_conv3_out&quot;)
  
          
          # Transposed conv 4 --&gt; BatchNorm --&gt; LeakyReLU
          # 64x64x128 --&gt; 128x128x64
          trans_conv4 = tf.layers.conv2d_transpose(inputs = trans_conv3_out,
                                    filters = 64,
                                    kernel_size = [5,5],
                                    strides = [2,2],
                                    padding = &quot;SAME&quot;,
                                  kernel_initializer=tf.truncated_normal_initializer(stddev=0.02),
                                  name=&quot;trans_conv4&quot;)
          
          batch_trans_conv4 = tf.layers.batch_normalization(inputs = trans_conv4, training=is_train, epsilon=1e-5, name=&quot;batch_trans_conv4&quot;)
         
          trans_conv4_out = tf.nn.leaky_relu(batch_trans_conv4, alpha=alpha, name=&quot;trans_conv4_out&quot;)
  
          
          # Transposed conv 5 --&gt; tanh
          # 128x128x64 --&gt; 128x128x3
          logits = tf.layers.conv2d_transpose(inputs = trans_conv4_out,
                                    filters = 3,
                                    kernel_size = [5,5],
                                    strides = [1,1],
                                    padding = &quot;SAME&quot;,
                                  kernel_initializer=tf.truncated_normal_initializer(stddev=0.02),
                                  name=&quot;logits&quot;)
           
          out = tf.tanh(logits, name=&quot;out&quot;)
          
          return out
  </code></pre>