Error when checking target: expected dense_1 to have shape (257, 257) but got array with shape (257, 1)

*爱你&永不变心* 提交于 2021-01-29 14:10:33

问题


print(X.shape,Y.shape)
#(5877, 257, 1) (5877, 257, 1)
model = Sequential()
model.add(LSTM(257, input_shape=(257,1),stateful=False,return_sequences=True))
model.add(Dense(257, activation='sigmoid'))
model.compile(loss=losses.mean_squared_error, optimizer='adam', metrics=['accuracy'])
model.fit(x=X,y=Y,epochs=100,shuffle=False)

Error when checking target: expected dense_1 to have shape (257, 257) but got array with shape (257, 1)

I should give 5877 frames of size 257 to lstm layer. The output has the same format. Where I was mistaken?

来源:https://stackoverflow.com/questions/50858871/error-when-checking-target-expected-dense-1-to-have-shape-257-257-but-got-ar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!