Input changing row count matrices in an MLP
First, I made the matrices (x, 129) to have the same shape by padding in with the rows filled with zeros.
Second, I transformed my large matrices into dimension 3 by the following process:
train = list(train_df['spec'])
np.array(train).shape
&gt;&gt;&gt; (50395, 71, 129)


X_train = list(train['spec']);     X_valid = list(valid['spec'])
y_train = train['label'].values;    y_valid = valid['label'].values
model.add(Dense(12, input_shape=(50395, 71, 129), activation='relu'));
model.fit(np.array(X_train), y_train, validation_data=(np.array(X_valid), y_valid), epochs=500, batch_size=1);