C4W3 UNet Graph disconnected

Hello,

in unet_model() function, I am getting error “Graph disconnected: cannot obtain value for tensor” on the final line to create the model (i.e. before return model and after the conv10)
What could this signify or where could I be going wrong?

Note:

  • I have passed n_classes as filter, kernel size of 1 & same padding to Conv2D on conv9 to get conv10
  • Code for obtain conv9 from ublock9 was already present (i.e. with args n_filters,3 as kernel,relu activation,same padding & he_normal)
  • Each of the ublocks is obtained by applying upsampling_block to each of the previous ublocks (arguments as previous ublock, 2nd parameter of corresponding cblock and n_filters halved at each stage)

Thanks

Your description sounds basically correct, yet there must still be an error somewhere.

Thanks I will check further. However, can you please let me know when do we typically encounter “Graph disconnected” errors? I tried checking on stackoverflow but it was not clear to me

To clarify exact error is: Graph disconnected: cannot obtain value for tensor Tensor(“input_6:0”, shape=(None, 96, 128, 3), dtype=float32) at layer “conv2d_6”. The following previous layers were accessed without issue: []

The last trace includes: /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/functional.py in _map_graph_network(inputs, outputs)

  • 929 'The following previous layers '*
  • 930 'were accessed without issue: ’ +*
    → 931 str(layers_with_complete_input))
  • 932 for x in nest.flatten(node.outputs):*
  • 933 computable_tensors.add(id(x))*

I do not know of any common way for that error to occur.
(edited)

1 Like

It is fixed. It was related to conversion of input_size, though I was doing it - it was not handled correctly. Detected with some debug print statements. I knew it would be a silly mistake, It pays to be persistent :slight_smile:
Thanks