问题
i am implementing a CLSTM based on This problem but facing error of dimensionality.
Data set: I am currently working on one video, which has 4500 images of size (28,28). The data set is in vectorized form so i get (4500,780). I split the images using Timeseriessplit and reshape the images with
x_train=x_train.reshape(-1, 28, 28, 1)
x_test=x_test.reshape(-1, 28, 28, 1)
My model is as follows
model = models.Sequential()
model.add(layers.ConvLSTM2D(
filters=40,
kernel_size=(3, 3),
input_shape=(None, 28, 28, 1),
padding='same',
return_sequences=True))
model.add(layers.BatchNormalization())
model.add(layers.ConvLSTM2D(
filters=40,
kernel_size=(3, 3),
padding='same',
return_sequences=True))
model.add(layers.BatchNormalization())
model.add(layers.ConvLSTM2D(
filters=40,
kernel_size=(3, 3),
padding='same',
return_sequences=True))
model.add(layers.BatchNormalization())
model.add(layers.AveragePooling3D((1, 28, 28)))
model.add(layers.Reshape((-1, 40)))
model.add(layers.Dense(
units=1,
activation='sigmoid'))
For every image i have one value correspondent value. (Regression Problem). The error i am getting is:
ValueError: Error when checking input: expected conv_lst_m2d_input to have 5 dimensions, but got array with shape (3407, 28, 28, 1)
来源:https://stackoverflow.com/questions/60041693/implementing-an-clstm-but-facing-dimension-error-problem