If anyone else stumbles on this issue. I obtained the same sort of problem when using an embedding layer and passing out of range indexes (indexes > num_embeddings). This rather cryptic error was pretty unhelpful to debug but hopefully this helps someone else.