title: Keras Model output shape is "(None,)"
body: <p>My model includes a previously loaded model, and gives an output shape of "(None,)":</p>
  
  <pre><code>from tensorflow.keras.models import Sequential, Model
  from tensorflow.keras.layers import Activation, Dense, Input, Subtract, Multiply, Lambda
  
  x = Input((158,))
  y = model(x)
  c = Subtract()([x,y])
  c = Multiply()([c,c])
  d = Lambda(lambda arg: tf.keras.backend.mean(arg,axis=1), output_shape = (None,1))
  e = d(c)
  
  new_model = Model(inputs = x, outputs = e)
  new_model.summary()
  
  Model: "model"
  __________________________________________________________________________________________________
  Layer (type)                    Output Shape         Param #     Connected to                     
  ==================================================================================================
  input_1 (InputLayer)            [(None, 158)]        0                                            
  __________________________________________________________________________________________________
  model_1 (Model)                 (None, 158)          57310       input_1[0][0]                    
  __________________________________________________________________________________________________
  subtract (Subtract)             (None, 158)          0           input_1[0][0]                    
                                                                   model_1[1][0]                    
  __________________________________________________________________________________________________
  multiply (Multiply)             (None, 158)          0           subtract[0][0]                   
                                                                   subtract[0][0]                   
  __________________________________________________________________________________________________
  lambda (Lambda)                 (None,)              0           multiply[0][0]                   
  ==================================================================================================
  Total params: 57,310
  Trainable params: 57,310
  Non-trainable params: 0
  __________________________________________________________________________________________________
  
  </code></pre>
  
  <p>This model outputs correct values, but it might be creating issues down the line with the next step of my work, so I would like to know what this output shape means, and if I have to correct it (as I saw no exemples of this case online).</p>
  
  <p><em>Edit</em> </p>
  
  <p>To specify, I'm not investigating about the <code>None</code> value, but the fact that it doesn't say <code>(None,1)</code>, is it the same thing ?</p>
  
  <p>As an exemple, this summary: </p>
  
  <pre><code>Layer (type)                 Output Shape              Param #
  =================================================================
  dense_1 (Dense)              (None, 2)                 4
  _________________________________________________________________
  dense_2 (Dense)              (None, 1)                 3
  =================================================================
  Total params: 7
  Trainable params: 7
  Non-trainable params: 0
  _________________________________________________________________
  </code></pre>
  
  <p>source: <a href="https://machinelearningmastery.com/visualize-deep-learning-neural-network-model-keras/" rel="nofollow noreferrer">https://machinelearningmastery.com/visualize-deep-learning-neural-network-model-keras/</a></p>