I am getting bellow error while running the code
“history = model.fit([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.
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()
Arguments:
Tx – length of the sequences in the corpus
LSTM_cell – LSTM layer instance
densor – Dense layer instance
reshaper – Reshape layer instance
Returns:
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))
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.