title: Getting "You must feed a value for placeholder tensor" error when using Keras model
body: <p>I am trying to implement a model in Keras and got the following error:</p>
  
  <blockquote>
    <p>You must feed a value for placeholder tensor</p>
  </blockquote>
  
  <p>Here is my model:</p>
  
  <pre><code>def create_base_network(input_shape, out_dims):
      model = Sequential()
      model.add(Conv2D(32, kernel_size=(3, 3),
                       activation='relu',
                       input_shape=input_shape))
      model.add(Conv2D(64, (3, 3), activation='relu'))
      model.add(MaxPooling2D(pool_size=(2, 2)))
      model.add(Dropout(0.25))
      model.add(Flatten())
      model.add(Dense(128, activation='relu'))
      model.add(Dropout(0.5))
      model.add(Dense(out_dims, activation='linear'))
  
      return model
  
  input_shape=(28,28,3)
  anchor_in = Input(shape=input_shape)
  pos_in = Input(shape=input_shape)
  neg_in = Input(shape=input_shape)
  
  base_network = create_base_network(input_shape, 128)
  anchor_out = base_network(anchor_in)
  pos_out = base_network(pos_in)
  neg_out = base_network(neg_in)
  
  merged = concatenate([anchor_out, pos_out, neg_out], axis=-1)
  
  model = Model(inputs=[anchor_in, pos_in, neg_in], outputs=merged)    
  </code></pre>
  
  <p>I then try to get the output from the sequential model using:</p>
  
  <pre><code>seq_fun = K.function([model.layers[0].input, model.layers[1].input, model.layers[2].input], [model.layers[3].get_output_at(0)])
  seq_output = seq_fun([a, p, n])[0]
  </code></pre>
  
  <p>The input to this is coming from a generator in form of a numpy array each with the required shape. The error message then is:</p>
  
  <pre><code>InvalidArgumentError: You must feed a value for placeholder tensor 'conv2d_1_input' with dtype float and shape [?,28,28,3]
   [[{{node conv2d_1_input}} = Placeholder[dtype=DT_FLOAT, shape=[?,28,28,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
   [[{{node dense_2/BiasAdd/_175}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_102_dense_2/BiasAdd", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
  </code></pre>
  
  <p>I don't really know what's going on.</p>