title: Input shape in keras (This loss expects targets to have the same shape as the output)
body: <p>this is my first time using keras, I'm trying to follow a tutorial I've found online and fit my own data to it. I have a matrix and binary labels.</p>
  
  <pre><code>&gt; str(d_train)
   num [1:1062, 1:180] -0.04748 0.04607 -0.05429 -0.0126 -0.00219 ...
  &gt; str(trainlabels)
   num [1:1062, 1:2] 0 0 0 0 0 0 1 0 0 0 ...
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code>model = keras_model_sequential()
  model %&gt;%
    layer_dense(units = 8, activation = 'relu', input_shape = c(180)) %&gt;%
    layer_dense(units = 3, activation = "softmax")
  summary(model)
  ## Compile
  model %&gt;%
    compile(loss = "binary_crossentropy",
            optimizer = "adam",
            metrics = "accuracy")
  ## Fit model
  history = model %&gt;%
    fit(d_train,
        trainlabels,
        epoch=200,
        batch_size=32,
        validation_split=0.2)
  </code></pre>
  
  <p>I can't seem to fit the model, I'm getting this error message:</p>
  
  <pre><code>Error in py_call_impl(callable, dots$args, dots$keywords) : 
    ValueError: A target array with shape (1062, 2) was passed for an output of shape (None, 3) while using as loss `binary_crossentropy`. This loss expects targets to have the same shape as the output.
  </code></pre>
  
  <p>Based on the error message, asking for different shape of my input array, I tried to change the dimensions around with no luck.</p>