title: Cannot set output layer to classification
body: <p>I am currently trying to implement a CNN which purpose is to perform classification, but for some reason am I not able to define my output dimension to 1. </p>
  
  <p>Here is an example code: </p>
  
  <pre><code>import keras
  from keras.layers.merge import Concatenate
  from keras.models import Model
  from keras.layers import Input, Dense
  from keras.layers import Dropout
  from keras.layers.core import Dense, Activation, Lambda, Reshape,Flatten
  from keras.layers import Conv2D, MaxPooling2D, Reshape, ZeroPadding2D
  import numpy as np
  
  train_data_1 = np.random.randint(100,size=(100,3,6,3))
  train_data_2 = np.random.randint(100,size=(100,3,6,3))
  test_data_1 = np.random.randint(100,size=(10,3,6,3))
  test_data_2 = np.random.randint(100,size=(10,3,6,3))
  labels_train_data =np.random.randint(145,size=100)
  labels_test_data =np.random.randint(145,size=10)
  
  
  input_img_1 = Input(shape=(3, 6, 3))
  input_img_2 = Input(shape=(3, 6, 3))
  
  conv2d_1_1 = Conv2D(filters = 32, kernel_size = (3,3) , padding = "same" , activation = 'relu' , name = "conv2d_1_1" )(input_img_1)
  conv2d_2_1 = Conv2D(filters = 64, kernel_size = (3,3) , padding = "same" , activation = 'relu' )(conv2d_1_1)
  conv2d_3_1 = Conv2D(filters = 64, kernel_size = (3,3) , padding = "same" , activation = 'relu' )(conv2d_2_1)
  conv2d_4_1 = Conv2D(filters = 32, kernel_size = (1,1) , padding = "same" , activation = 'relu' )(conv2d_3_1)
  conv2d_4_1_flatten = Flatten()(conv2d_4_1)
  
  conv2d_1_2 = Conv2D(filters = 32, kernel_size = (3,3) , padding = "same" , activation = 'relu' , name = "conv2d_1_2")(input_img_2)
  conv2d_2_2 = Conv2D(filters = 64, kernel_size = (3,3) , padding = "same" , activation = 'relu' )(conv2d_1_2)
  conv2d_3_2 = Conv2D(filters = 64, kernel_size = (3,3) , padding = "same" , activation = 'relu' )(conv2d_2_2)
  conv2d_4_2 = Conv2D(filters = 32, kernel_size = (1,1) , padding = "same" , activation = 'relu' )(conv2d_3_2)
  conv2d_4_2_flatten = Flatten()(conv2d_4_2)
  
  
  merge = keras.layers.concatenate([conv2d_4_1_flatten, conv2d_4_2_flatten])
  
  dense1 = Dense(100, activation = 'relu')(merge)
  dense2 = Dense(50,activation = 'relu')(dense1)
  dense3 = Dense(1 ,activation = 'softmax')(dense2)
  
  
  model = Model(inputs = [input_img_1, input_img_2] , outputs = dense3)
  model.compile(loss="sparse_categorical_crossentropy", optimizer="adam")
  
  print model.summary()
  
  labels_train = keras.utils.to_categorical(labels_train_data, num_classes=145)
  labels_test = keras.utils.to_categorical(labels_test_data, num_classes=145)
  
  hist_current = model.fit(x = [train_data_1, train_data_2],
                      y = labels_train,
                      shuffle=False,
                      validation_data=([test_data_1 ,test_data_2], labels_test),
                      validation_split=0.1,
                      epochs=150000,
                      batch_size = 15,
                      verbose=1)
  </code></pre>
  
  <p>And the error message being:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test_model.py", line 57, in &lt;module&gt;
      verbose=1)
    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 (100, 145)
  </code></pre>