title: keras: Use one model output as another model input
body: <p>I am adding a dense layer before InceptionResNetV2 model(pre-trained)
  This is InceptionResNetV2 output</p>
  
  <pre><code>model_base = InceptionResNetV2(include_top=True, weights='imagenet')
  x = model_base.get_layer('avg_pool').output
  x = Dense(3, activation='softmax')(x)
  </code></pre>
  
  <p>This is the layer will be added</p>
  
  <pre><code>input1 = Input(shape=input_shape1)
  pre1 = Conv2D(filters=3, kernel_size=(5, 5), padding='SAME', 
  input_shape=input_shape1, name='first_dense')(input1)
  pre = Model(inputs=input1, outputs=pre1)
  </code></pre>
  
  <p>This is combining two models</p>
  
  <pre><code> after = Model(inputs=pre.output, outputs=x)
  
   model = Model(inputs=input1, outputs=after.output)
  
   model.compile(optimizer='sgd', loss='categorical_crossentropy', metrics=['accuracy'])
  </code></pre>
  
  <p>use </p>
  
  <pre><code>pre.output
  </code></pre>
  
  <p>as </p>
  
  <pre><code>after.input
  </code></pre>
  
  <p>But it doesn't works . How can I resolve it?</p>