TFViT model keeps throwing error while training it using TFTrainer
So I wanted to train TFViT for image captioning problem but the problem is I kept gettingthe model I usedmodel = TFVisionEncoderDecoderModel.from_encoder_decoder_pretrained(config.ENCODER, config.DECODER)ile "/usr/local/lib/python3.10/dist-packages/transformers/trainer_tf.py", line 710, in distributed_training_steps  *
        self.args.strategy.run(self.apply_gradients, inputs)
    File "/usr/local/lib/python3.10/dist-packages/transformers/trainer_tf.py", line 655, in apply_gradients  *
        self.optimizer.apply_gradients(list(zip(gradients, self.model.trainable_variables)))
    File "/usr/local/lib/python3.10/dist-packages/keras/optimizers/optimizer.py", line 1174, in apply_gradients  **
        return super().apply_gradients(grads_and_vars, name=name)
    File "/usr/local/lib/python3.10/dist-packages/keras/optimizers/optimizer.py", line 637, in apply_gradients
        self.build(trainable_variables)
    File "/usr/local/lib/python3.10/dist-packages/keras/optimizers/adam.py", line 139, in build
        self.add_variable_from_reference(
    File "/usr/local/lib/python3.10/dist-packages/keras/optimizers/optimizer.py", line 1105, in add_variable_from_reference
        with strategy.extended.colocate_vars_with(model_variable):

    AttributeError: 'NoneType' object has no attribute 'extended'TensorFlow version: 2.12.0
Transformers version: 4.30.2