title: Trying to build an ensemble in Keras. Getting a graph disconnected error
body: <p></p>
  
  <pre class="lang-python prettyprint-override"><code>from keras.models import load_model
  import h5py
  
  # sq_model.save_weights('sq_model_weights.h5')
  # res_model.save_weights('res_model_weights.h5')
  # model.save('my_model.h5')
  
  # dense_model.save_weights('dense_model_v3_weights.h5')
  
  sq_model.load_weights('sq_model_weights.h5')
  res_model.load_weights('res_model_weights.h5')
  dense_model.load_weights('dense_model_v2_weights.h5')
  
  
  models = [sq_model, res_model, dense_model]
  
  
  model_input = Input((3,32,32))
  
  def ensemble(models, model_input):
  
      outputs = [model.outputs[0] for model in models]
      y = Average()(outputs)
  
      model = Model(inputs = model_input, outputs = y, name='ensemble')
  
      return model
  
  
  ensemble_model = ensemble(models,model_input)
  </code></pre>
  
  <p>I am getting the following error when I run the above code:</p>
  
  <p>RuntimeError: Graph disconnected: cannot obtain value for tensor Tensor("input_2:0", shape=(?, 3, 32, 32), dtype=float32) at layer "input_2". The following previous layers were accessed without issue: []</p>