Here's my code:
from keras.layers import LSTM, Bidirectional, Dense, Input, Flatten
from keras.models import Model
input = Input(shape=(None, 100))
lstm_out = Bidirectional(LSTM(10, return_sequences=True))(input)
something = Flatten()(lstm_out)
output = Dense(22, activation='softmax')(something)
model = Model(inputs=input, outputs=output)
model.compile(loss='categorical_crossentropy', optimizer='adadelta', metrics=['accuracy'])
I'm building an LSTM with variable input through
this stackoverflow question. But now my model is saying ValueError: The shape of the input to "Flatten" is not fully defined (got (None, 20)
. How can I fix this?
Thanks in advance