Ошибка при добавлении слоя Maxpooling в модель ConvLSTM - PullRequest
0 голосов
/ 21 мая 2019

Я хочу добавить слой Maxpooling1D после слоя ConvLSTM2D. Имеет ли смысл добавлять слой maxpooling после слоя convlstm2d?

Размеры моего набора данных

samples, n_features, n_outputs = trainX.shape[0], trainX.shape[2], trainy.shape[1]
print('trainX.shape', trainX.shape) # (7000, 200, 5)
print('testX.shape', testX.shape) # (3000, 200, 5)
print('trainy.shape', trainy.shape) # (7000, 4)
print('testy.shape', testy.shape) # (3000, 4)
# reshape into subsequences (samples, time steps, rows, cols, channels)
n_features = trainX.shape[2]
n_steps, n_length = 4, 50
trainX = trainX.reshape((samples, n_steps, 1, n_length, n_features))
testX = testX.reshape((testX.shape[0], n_steps, 1, n_length,  n_features))

model = Sequential()
model.add(ConvLSTM2D(filters=64, kernel_size=(1,3),    activation='relu',return_sequences = True, input_shape=(n_steps, 1, n_length, n_features)))
model.add(MaxPooling1D(pool_size=3, strides=None, data_format='channels_last'))
model.add(BatchNormalization())

Я получаю следующую ошибку,

ValueError: Input 0 is incompatible with layer max_pooling1d_5: expected ndim=3, found ndim=5
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...