title: Graph disconnected: cannot obtain value for tensor Tensor Input Keras Python
body: <p>I have this code:</p>
  
  <pre><code># Declare the layers
  inp1 = Input(shape=input_shape, name="input1")
  inp2 = Input(shape=input_shape, name="input2")
  
  
  # 128 -&gt; 64
  conv1_inp1 = Conv2D(start_neurons * 1, 3, activation="relu", padding="same")(inp1)
  conv1_inp2 = Conv2D(start_neurons * 1, 3, activation="relu", padding="same")(inp2)
  conv1 = Concatenate()([conv1_inp1, conv1_inp2])
  conv1 = Conv2D(start_neurons * 1, 3, activation="relu", padding="same")(conv1)
  conv1 = MaxPooling2D((2, 2))(conv1)
  conv1 = Dropout(0.25)(conv1)
  
  # 64 -&gt; 32
  conv2 = Conv2D(start_neurons * 2, (3, 3), activation="relu", padding="same")(conv1)
  conv2 = Conv2D(start_neurons * 2, (3, 3), activation="relu", padding="same")(conv2)
  pool2 = MaxPooling2D((2, 2))(conv2)
  pool2 = Dropout(0.5)(pool2)
  
  # 32 -&gt; 16
  conv3 = Conv2D(start_neurons * 4, (3, 3), activation="relu", padding="same")(pool2)
  conv3 = Conv2D(start_neurons * 4, (3, 3), activation="relu", padding="same")(conv3)
  pool3 = MaxPooling2D((2, 2))(conv3)
  pool3 = Dropout(0.5)(pool3)
  
  # 16 -&gt; 8
  conv4 = Conv2D(start_neurons * 8, (3, 3), activation="relu", padding="same")(pool3)
  conv4 = Conv2D(start_neurons * 8, (3, 3), activation="relu", padding="same")(conv4)
  pool4 = MaxPooling2D((2, 2))(conv4)
  pool4 = Dropout(0.5)(pool4)
  
  # Middle
  convm = Conv2D(start_neurons * 16, (3, 3), activation="relu", padding="same")(pool4)
  convm = Conv2D(start_neurons * 16, (3, 3), activation="relu", padding="same")(convm)
  
  # 8 -&gt; 16
  deconv4 = Conv2DTranspose(start_neurons * 8, (3, 3), strides=(2, 2), padding="same")(convm)
  uconv4 = Concatenate()([deconv4, conv4])
  uconv4 = Dropout(0.5)(uconv4)
  uconv4 = Conv2D(start_neurons * 8, (3, 3), activation="relu", padding="same")(uconv4)
  uconv4 = Conv2D(start_neurons * 8, (3, 3), activation="relu", padding="same")(uconv4)
  
  # 16 -&gt; 32
  deconv3 = Conv2DTranspose(start_neurons * 4, (3, 3), strides=(2, 2), padding="same")(uconv4)
  uconv3 = Concatenate()([deconv3, conv3])
  uconv3 = Dropout(0.5)(uconv3)
  uconv3 = Conv2D(start_neurons * 4, (3, 3), activation="relu", padding="same")(uconv3)
  uconv3 = Conv2D(start_neurons * 4, (3, 3), activation="relu", padding="same")(uconv3)
  
  # 32 -&gt; 64
  deconv2 = Conv2DTranspose(start_neurons * 2, (3, 3), strides=(2, 2), padding="same")(uconv3)
  uconv2 = Conv2D(start_neurons * 2, (3, 3), activation="relu", padding="same")(uconv2)
  uconv2 = Conv2D(start_neurons * 2, (3, 3), activation="relu", padding="same")(uconv2)
  
  # 64 -&gt; 128
  deconv1 = Conv2DTranspose(start_neurons * 1, (3, 3), strides=(2, 2), padding="same")(uconv2)
  uconv1 = Conv2D(start_neurons * 1, (3, 3), activation="relu", padding="same")(deconv1)
  uconv1 = Conv2D(start_neurons * 1, (3, 3), activation="relu", padding="same")(uconv1)
  
  uncov1 = Dropout(0.5)(uconv1)
  output_layer = Conv2D(1, (1,1), padding="same", activation="sigmoid")(uconv1)
  
  
  
  # Declare the model and add the layers
  model = Model(inputs = [inp1, inp2], outputs = output_layer)
  
  model.summary()
  model.compile(optimizer='adam',loss='binary_crossentropy')
  </code></pre>
  
  <p>And it generates this error :</p>
  
  <pre><code>Graph disconnected: cannot obtain value for tensor Tensor("input_28:0", shape=(?, 128, 128, 1), dtype=float32) at layer "input_28". The following previous layers were accessed without issue: []
  </code></pre>
  
  <p>The inputs have the same shape and in some forums, they say that the problem comes from the fact that the inputs are coming from 2 different sources therefore breaking the link that you had before.</p>
  
  <p>I don't really know how to fix that.</p>
  
  <p>Can anyone help me?</p>
  
  <p>Thanks in advance.</p>