@TMosh Thanks for pointing me in the right direction. I had a problem in my Dense layer where I had too many of them, so the number of parameters was not correct. I have it working now.
I got the same error because I defined a new layer as Dense(machine_vocab_size,activation=“softmax”)(s) instead of
output_layer. Using output_layer fixed the error.