输入3D数据到LSTM

时间:2019-09-17 13:31:07

标签: python-3.x keras lstm

我想在3D数据上拟合模型。

Y = pd.get_dummies(tag_data['tag']).values
X_train, X_test, Y_train, Y_test = train_test_split(X,Y, test_size = 0.20, random_state = 42)
print(X_train.shape,Y_train.shape)
print(X_test.shape,Y_test.shape)
batch_size = 32
model.fit(X_train, Y_train, epochs = 10, batch_size=batch_size, verbose = 2)
(7, 273, 10) (7, 2)
(2, 273, 10) (2, 2)

ValueError: Error when checking input: expected embedding_2_input to have 2 dimensions, but got array with shape (7, 273, 10)

0 个答案:

没有答案