Course 5 Sequence model week 1 assignment 3 Jazz improve model

Hello All,

I am getting bellow error while running the code
“history =[X, a0, c0], list(Y), epochs=100,verbose=0)”

_SymbolicException: Inputs to eager execution function cannot be Keras symbolic tensors, but found [<tf.Tensor ‘input_6:0’ shape=(None, 30, 90) dtype=float32>]

Can anyone helpme to understand why i am getting this error.

There is an error in your djmodel() function.

Okay…but i m not getting any error in
model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper)

this code… also i m getting the expected output after running this statement…

also i am just for information i am using below function to run the code
def djmodel(Tx, LSTM_cell, densor, reshaper):
Implement the djmodel composed of Tx LSTM cells where each cell is responsible
for learning the following note based on the previous note and context.
Each cell has the following schema:
[X_{t}, a_{t-1}, c0_{t-1}] → RESHAPE() → LSTM() → DENSE()
Tx – length of the sequences in the corpus
LSTM_cell – LSTM layer instance
densor – Dense layer instance
reshaper – Reshape layer instance

    model -- a keras instance model with inputs [X, a0, c0]
# Get the shape of input values
n_values = densor.units

# Get the number of the hidden state vector
n_a = LSTM_cell.units

# Define the input layer and specify the shape
X = Input(shape=(Tx, n_values))


The error is triggered when the cell tries to fit the model with a data set.

I had a similar problem with the “history” block. Back in my “djmodel” function I changed the way I appended outputs and this seemed to fix it.
I used outputs.append(out)
instead of outputs = [outputs, out]
even though either passed the initial tests.