try passing for example, name=‘ctx_encoder’, as a kwarg to more components (like you do for layers) and calling
super().__init__(config, **kwargs)

inside of them.
Like this:
image1526×218 24.1 KB
That’s how I debugged some tensorflow layer name issues (like the one you have),
but I’m no expert.