2

My question is a different from these questions as it's related to a built-in model.

Keras cnn model output shape doesn't match model summary

Keras - CNN Model Summary Diemension Interpretation

I'm trying to examine the built-in Xception model for transfer learning and used model.summary():

Here are the first few layers of the Xception model

 Layer (type)                    Output Shape         Param      Connected to                     
==================================================================================================
input_1 (InputLayer)            (None, None, None, 3 0                                            
__________________________________________________________________________________________________
block1_conv1 (Conv2D)           (None, None, None, 3 864         input_1[0][0]                    
__________________________________________________________________________________________________
block1_conv1_bn (BatchNormaliza (None, None, None, 3 128         block1_conv1[0][0]               
______________________________________________________________________________________

My concern is with the depth channel. Shouldn't the depth output of the block1_conv1 (Conv2D) be 32 and not 3?

If I figure out the output via get_layer, I get the correct output:

base_model.get_layer(index = 1).output
<tf.Tensor 'block1_conv1/convolution:0' shape=(?, ?, ?, 32) dtype=float32>



base_model = Xception(weights='imagenet', include_top=False)
print(base_model.summary())
Moondra
  • 4,399
  • 9
  • 46
  • 104
  • 1
    This is not a valid question. If you carefully observe that line you can see the right parentheses is missing. It should be `(None, None, None, 32)` but the `summary()` function prints with fixed number of columns therefore `2)` was missing. Btw, on my computer I saw `(None, None, None, 32`. – Tay2510 Feb 03 '18 at 04:28
  • Ah I see. I'm running it from the Python shell that comes with Python. What are you running it from? – Moondra Feb 03 '18 at 05:10
  • I run it in my Linux terminal. – Tay2510 Feb 03 '18 at 16:56

0 Answers0