我尝试创建模型:
model = Sequential()
model.add(Dense(100, input_shape=X_train.shape))
model.add(LSTM(100))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
但是当我尝试运行它时,model.fit(X_train, Y_train, epochs=1)
会抛出
ValueError: Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=2
谢谢!
PS。我知道其他问题,但是他们没有帮助我。