ValueError: Error when checking target: expected dense_3 to have shape (1,) but got array with shape (2,)
Problem is in the output layer and you are using categorical_crossentropy for a loss function. Quoting Keras documentation:


  Note: when using the categorical_crossentropy loss, your targets
  should be in categorical format (e.g. if you have 10 classes, the
  target for each sample should be a 10-dimensional vector that is
  all-zeros except for a 1 at the index corresponding to the class of
  the sample). In order to convert integer targets into categorical
  targets, you can use the Keras utility to_categorical:


I would check if the target values are defined consistently. They seem to be defined for sparse_categorical_crossentropy, which requires a dense layer where number of neurons = number of classes of the problem. If they are defined as integers - as required for sparse_categorical_crossentropy, you can convert them to categorical formatting using to_categorical function, also defined in the documentation page linked above; or you can keep them as integers, and change the number of neurons in the final layer to 2, and loss function to sparse_categorical_crossentropy.