When I Run this code:
model = Sequential([
LSTM(300, activation='tanh', input_shape=data.shape, recurrent_activation='sigmoid'),
Dropout(0.2),
Dense(4, activation='linear')
])
model.compile(optimizer='adam', loss='mse')
history = model.fit_generator(training, epochs=22, steps_per_epoch=1)
This error pops up:
ValueError: cannot copy sequence with size 7 to array axis with dimension 5
I don't know how to handle that. Yesterday, the code worked perfectly. In other threads I've found; the error might be related to np.vstack. This is the thread I'm writing about.
I've tried to change the data to a np.array but it did not work. Can anyone help?
This might be useful:
training = TimeseriesGenerator(data, data, length=7, batch_size=6)
TimeseriesGenerator is from keras.preprocessing.sequence