title: Models passed to `fit` can only have `training` and the first argument in `call` as positional arguments, found
body: <p>I am trying to follow this code but on another data set:<a href="https://www.tensorflow.org/tutorials/text/transformer#encoder_layer" rel="noreferrer">https://www.tensorflow.org/tutorials/text/transformer#encoder_layer</a>
  I needed to compile and fit the model. however, I get this error while running; I don't know what it means:</p>
  
  <pre><code> Models passed to `fit` can only have `training` and the first argument in `call` as positional arguments, found: ['tar', 'enc_padding_mask', 'look_ahead_mask', 'dec_padding_mask'].
  </code></pre>
  
  <p>Here it is the model:</p>
  
  <pre><code>class Transformer(tf.keras.Model):
    def __init__(self, num_layers, d_model, num_heads, dff, input_vocab_size, 
                 target_vocab_size, pe_input, pe_target, rate=0.1,**kwargs,):
      super(Transformer, self).__init__(**kwargs)
  
      self.encoder = Encoder(num_layers, d_model, num_heads, dff, 
                             input_vocab_size, pe_input, rate)
  
      self.decoder = Decoder(num_layers, d_model, num_heads, dff, 
                             target_vocab_size, pe_target, rate)
  
      self.final_layer = tf.keras.layers.Dense(target_vocab_size)
    def get_config(self):
  
          config = super().get_config().copy()
          config.update({
              'dff':self.dff,
              'input_vocab_size':self.input_vocab_size,
              'target_vocab_size':self.target_vocab_size,
              'pe_input':self.pe_input,
              'pe_target':self.pe_target,
              #'vocab_size': self.vocab_size,
              'num_layers': self.num_layers,
              #'units': self.units,
              'd_model': self.d_model,
              'num_heads': self.num_heads,
              'rate': self.rate,
          })
          return config
  
    def call(self, inp, tar, training, enc_padding_mask, 
             look_ahead_mask, dec_padding_mask):
  
      enc_output = self.encoder(inp, training, enc_padding_mask)  # (batch_size, inp_seq_len, d_model)
  
      # dec_output.shape == (batch_size, tar_seq_len, d_model)
      dec_output, attention_weights = self.decoder(
          tar, enc_output, training, look_ahead_mask, dec_padding_mask)
  
      final_output = self.final_layer(dec_output)  # (batch_size, tar_seq_len, target_vocab_size)
      #    return final_output, attention_weights
  
  
      return tf.keras.Model(inputs=[inputs, dec_inputs], outputs=outputs, name=name)
  </code></pre>
  
  <p>and creating the model, compiling it, and fitting it as follows:</p>
  
  <pre><code>transformer = Transformer(num_layers, d_model, num_heads, dff,
                            input_vocab_size, target_vocab_size, 
                            pe_input=input_vocab_size, 
                            pe_target=target_vocab_size,
                            rate=dropout_rate)
  
  transformer.compile(optimizer=optimizer, loss=loss_function, metrics=[accuracy])
  
  transformer.fit(dataset, epochs=EPOCHS)
  </code></pre>
  
  <p>EDIT: Bases on @Geeocode updated the def function in transformer class to be:</p>
  
  <pre><code>def call(self, inp, tar, enc_padding_mask,look_ahead_mask, dec_padding_mask, training=False,):
  
      enc_output = self.encoder(inp, training, enc_padding_mask)  # (batch_size, inp_seq_len, d_model)
  
      # dec_output.shape == (batch_size, tar_seq_len, d_model)
      dec_output, attention_weights = self.decoder(
          tar, enc_output, training, look_ahead_mask, dec_padding_mask)
  
      final_output = self.final_layer(dec_output)  # (batch_size, tar_seq_len, target_vocab_size)
      return final_output, attention_weights
  </code></pre>
  
  <p>However, I still get the same error</p>