I have a dataset, where each sample is a variable number of timesteps, and within each timestep there are exact 5 floats. I want to train an RNN/LSTM that predicts a single value:
sample_1 = [[1.0, 2.0, 3.0, 4.0, 5.0], [5.0, 4.0, 3.0, 2.0, 1.0].....]
train_x = [sample_1, sample_2.....] train_y = [123.0, 456.0.....]
My Sequential Keras LSTM model looks as follows:
model = Sequential()
model.add(LSTM(units=4, dropout=0.5))
model.add(Dense(units=4, activation='relu'))
model.add(Dense(1))
model.compile(loss='mean_absolute_error',
optimizer=Adam())
and to train:
_ = model.fit(
train_x,
train_y,
validation_data=(validation_x, validation_y),
shuffle=True,
batch_size=16,
epochs=10,
verbose=2)
But, I Immediately get the following error:
"ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type list)."
Is there anything explicitly wrong with my model setup? Is it ok for me to simply be using a nested list of lists as the input examples?