The reasons of the error:
I was passing state_h and state_c that were symbolic tensors. What I needed it was to calculate them first with an encoder model.
state_h
state_c