Incorrect output dimension? I am trying to start the learning of a cnn network which has 72 input and one output being a vector of length 24 stating the a class for each third input 72/24 = 3. There are 145 classes. 

this is how i've designed the network currently passed my data:

print "After test_output/input"

print "Length:"
print len(data_train_input)
print len(data_train_output)

print len(data_test_input)
print len(data_test_output)

print "Type;"
print type(data_train_input[0])
print type(data_train_output[0])

print "Size [0]"
print data_train_input[0].shape
print data_train_output[0].shape

list_of_input = [Input(shape = (78,3)) for i in range(72)]
list_of_conv_output = []
list_of_max_out = []
for i in range(72):
    list_of_conv_output.append(Conv1D(filters = 32 , kernel_size = 6 , padding = "same", activation = 'relu')(list_of_input[i]))
    list_of_max_out.append(MaxPooling1D(pool_size=3)(list_of_conv_output[i]))

merge = keras.layers.concatenate(list_of_max_out)
reshape = Reshape((-1,))(merge)

dense1 = Dense(500, activation = 'relu')(reshape)
dense2 = Dense(250,activation = 'relu')(dense1)
dense3 = Dense(1 ,activation = 'softmax')(dense2)

model = Model(inputs = list_of_input , outputs = dense3)
model.compile(loss="sparse_categorical_crossentropy", optimizer="adam" , metrics = [metrics.sparse_categorical_accuracy])

reduce_lr=ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=3, verbose=1, mode='auto', epsilon=0.01, cooldown=0, min_lr=0.000000000000000000001)
stop  = EarlyStopping(monitor='val_loss', min_delta=0, patience=5, verbose=1, mode='auto')

print "Train!"
list_train_input = []
list_test_input = []

for i in range(len(data_train_input)):
    list_train_input.append(data_train_input[i])

for i in range(len(data_test_input)):
    list_test_input.append(data_test_input[i])

hist_current = model.fit(x = [np.array(list_train_input[i]) for i in range(72)],
                    y = np.array(data_train_output),
                    shuffle=False,
                    validation_data=([np.array(list_test_input[i]) for i in range(72)], np.array(data_test_output)),
                    validation_split=0.1,
                    epochs=150000,
                    verbose=1,
                    callbacks=[reduce_lr,stop])


Which generates this output: 

After test_output/input
Length:
9436
9417
1017
1035
Type;
&lt;type 'numpy.ndarray'&gt;
&lt;type 'numpy.ndarray'&gt;
Size [0]
(72, 78, 3)
(24,)
Train!
Traceback (most recent call last):
  File "keras_cnn_phoneme_classification.py", line 382, in &lt;module&gt;
    model(train_input_data_interweawed_normalized, output_train, test_input_data_interweawed_normalized, output_test, test_name_interweawed_normalized)
  File "keras_cnn_phoneme_classification.py", line 361, in model
    callbacks=[reduce_lr,stop])
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1405, in fit
    batch_size=batch_size)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1299, in _standardize_user_data
    exception_prefix='model target')
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 133, in _standardize_input_data
    str(array.shape))
ValueError: Error when checking model target: expected dense_3 to have shape (None, 1) but got array with shape (9417, 24)


Why am i getting this error? 
I tried changing the output size of the dense3 to many  different?  but is is it expecting?
The error message is pretty clear... you feed a vector of length 24 to your model, but your model is outputting a vector of length 1.

Change :

dense3 = Dense(1 ,activation = 'softmax')(dense2)


to :

dense3 = Dense(24 ,activation = 'softmax')(dense2)