C5 W1 E3 - Jazz - Music Inference Model Error: Graph Disconnected

Hi,

I am stuck on this problem for quite some time and I didn’t know how to address it. I’ve checked the dimensions for x through the function suggested by mentors and it is correct, but I encounter this error:

Graph disconnected: cannot obtain value for tensor Tensor("input_5:0", shape=(None, 1, 90), dtype=float32) at layer "lstm_4". The following previous layers were accessed without issue: []

While restarting the kernel or rerunning the block, I’ve found that the error happens in different layer each time such as “lstm_4”, “lstm_3” …

It also gives a funny warning:

WARNING:tensorflow:Functional inputs must come from `tf.keras.Input` (thus holding past layer metadata), they cannot be the output of a previous non-Input layer. Here, a tensor specified as input to "functional_4" was not an Input tensor, it was generated by layer repeat_vector_149.
Note that input tensors are instantiated via `tensor = tf.keras.Input(shape)`.
The tensor that caused the issue was: repeat_vector_149/Tile:0

In the error message, the graph disconnected error is pointed to the model line.

ValueError                                Traceback (most recent call last)
<ipython-input-26-c55ce93f25e1> in <module>
      1 LSTM_cell = LSTM(n_a, return_state = True)
----> 2 inference_model = music_inference_model(LSTM_cell, densor, Ty = 50)

<ipython-input-25-a67ee3af6354> in music_inference_model(LSTM_cell, densor, Ty)
     56 
     57     # Step 3: Create model instance with the correct "inputs" and "outputs" (≈1 line)
---> 58     inference_model = Model(inputs=[x, a0, c0], outputs=outputs)
     59 
     60     ### END CODE HERE ###

I cannot identify the error with my limited knowledge, can anyone explain this problem?

Best regards,
Thank you!

The issue is that in Step 3, ‘x’ is not the correct variable to use in the “inputs” tuple.

1 Like