

TITLE
TypeError: on_init_end() got an unexpected keyword argument 'model'

COMMENTS
3

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 0

BODY
## Environment info

- `transformers` version: 4.0.0
- Python 3.6.10
- Pytorch version: 1.6.0
- pytorch-lightning version: 1.0.3

I'm using aws_neuron_pytorch_p36 virtual environment (on p3 ec2 instance). Regarding pytorch-lightning version, the above version is the highest one I can currently use (higher versions are not supported in my framework)

### Who can help
@LysandreJik
@sgugger

## Information

Model I am using RobertaForSequenceClassification


## To reproduce

The code I'm running:

```
from transformers import RobertaForSequenceClassification
from transformers import Trainer, TrainingArguments

from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning import metrics

model = RobertaForSequenceClassification.from_pretrained(
                self.training_configuration.hyper_params.pretrained_model_path, num_labels=2)

model_checkpoint = ModelCheckpoint(filepath = model_path,
                                           verbose=1,
                                           save_top_k=1,
                                           save_weights_only=True,
                                           monitor=self.training_configuration.monitor,
                                           mode=self.training_configuration.monitor_mode,
                                           period=1)
  
early_stopping = EarlyStopping(monitor=self.training_configuration.monitor,
                                       patience=self.training_configuration.patience,
                                       mode=self.training_configuration.monitor_mode)


training_args = TrainingArguments(
            output_dir=os.path.dirname(model_path),  # output directory
            evaluation_strategy="epoch",  # Evaluation is done at the end of each epoch.
            num_train_epochs=self.training_configuration.epoch,  # total number of training epochs
            per_device_train_batch_size=self.training_configuration.batch_size,  # batch size per device during training
            per_device_eval_batch_size=self.training_configuration.batch_size,  # batch size for evaluation
            warmup_steps=warmup_steps,  # number of warmup steps for learning rate scheduler
            weight_decay=self.training_configuration.hyper_params.weight_decay,  # strength of weight decay
            save_total_limit=1,  # limit the total amount of checkpoints. Deletes the older checkpoints.
        )

trainer = Trainer(
            model=model,  # the instantiated 🤗 Transformers model to be trained
            args=training_args,  # training arguments, defined above
            train_dataset=training_data,  # training dataset
            eval_dataset=validation_data,  # evaluation dataset
            callbacks=[early_stopping, model_checkpoint],
            compute_metrics = metrics.classification.Accuracy()
        )

trainer.train()
```

The error I'm getting:

```
    compute_metrics = metrics.classification.Accuracy()
  File "/home/ec2-user/anaconda3/envs/aws_neuron_pytorch_p36/lib/python3.6/site-packages/transformers/trainer.py", line 305, in __init__
    self.control = self.callback_handler.on_init_end(self.args, self.state, self.control)
  File "/home/ec2-user/anaconda3/envs/aws_neuron_pytorch_p36/lib/python3.6/site-packages/transformers/trainer_callback.py", line 331, in on_init_end
    return self.call_event("on_init_end", args, state, control)
  File "/home/ec2-user/anaconda3/envs/aws_neuron_pytorch_p36/lib/python3.6/site-packages/transformers/trainer_callback.py", line 382, in call_event
    **kwargs,
TypeError: on_init_end() got an unexpected keyword argument 'model'
```
