I actually got the same error and my mistake was that the model was expecting the input and labels in a different format while I was passing them in an incorrect format.
Additionally can you provide a Minimum working example (MWE)? It would be easier to find out the problem that way.