Hi!
The following error is thrown by line x += self.pos_encoding(maximum_position_encoding, self.embedding_dim)
in the Decoder#call
method:
TypeError: Exception encountered when calling layer 'decoder' (type Decoder).
'tensorflow.python.framework.ops.EagerTensor' object is not callable
Call arguments received by layer 'decoder' (type Decoder):
• x=tf.Tensor(shape=(3, 4), dtype=int64)
• enc_output=tf.Tensor(shape=(3, 7, 9), dtype=float64)
• training=False
• look_ahead_mask=tf.Tensor(shape=(1, 4, 4), dtype=float32)
• padding_mask=None
When I remove self.embedding_dim
from the arguments passed into the self.pos_encoding
method, I get a similar error:
TypeError: Exception encountered when calling layer 'decoder_1' (type Decoder).
'tensorflow.python.framework.ops.EagerTensor' object is not callable
Call arguments received by layer 'decoder_1' (type Decoder):
• x=tf.Tensor(shape=(3, 4), dtype=int64)
• enc_output=tf.Tensor(shape=(3, 7, 9), dtype=float64)
• training=False
• look_ahead_mask=tf.Tensor(shape=(1, 4, 4), dtype=float32)
• padding_mask=None
And here is what I am passing the self.dec_layers
: x, block1, block2 = self.dec_layers(x, enc_output, training, look_ahead_mask, padding_mask)
.
When I add return_attention_scores=True
to the arguments just above I get a third similar error that seems to indicate I’m making progress but I can’t quite figure out what the issue is:
TypeError: Exception encountered when calling layer 'decoder_2' (type Decoder).
'tensorflow.python.framework.ops.EagerTensor' object is not callable
Call arguments received by layer 'decoder_2' (type Decoder):
• x=tf.Tensor(shape=(3, 4), dtype=int64)
• enc_output=tf.Tensor(shape=(3, 7, 9), dtype=float64)
• training=False
• look_ahead_mask=tf.Tensor(shape=(1, 4, 4), dtype=float32)
• padding_mask=None
Do you know where this might come from?
Thanks!