如何解决“输入张量必须具有等级4”的错误?

时间:2019-10-01 10:35:05

标签: keras neural-network conv-neural-network lstm

X_train shape :  (13973, 100, 6, 5) 
X_test shape :  (3494, 100, 6, 5) 
y_train shape :  (13973, 6, 5) 
Y_test shape :  (3494, 6, 5)

代码:

model = Sequential()
model.add(TimeDistributed(Conv2D(32,5,5,input_shape=(100,6,5))))
model.add(TimeDistributed(MaxPooling2D(pool_size=(4,4))))
model.add(Activation('relu'))
model.add(TimeDistributed(Flatten()))
model.add(LSTM(256, return_sequences=True))
model.add(TimeDistributed(Dense(5)))
model.add(Activation('softmax'))
model.compile(loss="mse",optimizer="adam")

得到

的错误
  

输入张量必须具有等级4?

0 个答案:

没有答案