Predicting value using LSTM

I'm currently learning about LSTM and want to make a prediction using an array as an input and have an output as a single value. I currently trying to do that by using this model:

    input1 = Input(shape=(2,200,3))
    lstm1 = Bidirectional(LSTM(units=32))(input1)
    dnn_hidden_layer1 = Dense(3, activation='relu')(lstm1)
    dnn_output = Dense(1, activation='sigmoid')(dnn_hidden_layer1)
    model = Model(inputs=[input1],outputs=[dnn_output])
    model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
    model.summary()
    return model

and I got this error Input 0 of layer bidirectional_1 is incompatible with the layer: expected ndim=3, found ndim=4. Full shape received: (None, 2, 200, 3)

as my xtrain shape is 2,200,3 and my ytrain is 1,1. before I try the same model using an input array with shape (5,2,2) and it works, but now I'm stuck

Topic data-science-model cnn lstm keras tensorflow

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.