Hello,
I have created my own trainer with a custom loss function;
from torch.nn import CrossEntropyLoss

device = torch.device("cuda")
class_weights = torch.from_numpy(class_weights).float().to(device)

class MyTrainer(Trainer):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)    

def compute_loss(self, model, inputs):
    labels = inputs.pop("labels")
    outputs = model(**inputs)
    logits = outputs[0]
    loss = CrossEntropyLoss(weight=class_weights)
    return loss(logits, labels)

Yet, after Training for an hour, It went to do an evaluation and I got this error;
TypeError: compute_loss() got an unexpected 
keyword argument 'return_outputs'

I don’t have compute_loss() variable within my code so I don’t think it was me inputting something to it. I was thinking perhaps it has to do with my custom loss?
by the way, this is my trainer:
trainer = MyTrainer(
    args=training_args,                  # training arguments, defined above
    train_dataset=train_dataset,         # training dataset
    eval_dataset=val_dataset,             # evaluation dataset
    model_init=model_init,
   compute_metrics=compute_metrics,

)