# Key Error ‘loss’ - finetuning \[ arabert , mbert \]

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkey-error-loss-finetuning-arabert-mbert%2F13052%3E%5C
**Category:** Beginners\
**Created:** [December 22, 2021, 7:49pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkey-error-loss-finetuning-arabert-mbert%2F13052 "2021-12-22T19:49:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![s3h](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@s3h](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fs3h)%5C
**Post date:** [December 22, 2021, 7:49pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkey-error-loss-finetuning-arabert-mbert%2F13052%2F1 "2021-12-22T19:49:22Z")

</div>

Hello all!  
I am trying to fine-tune mbert and arabert models on translation task as explained [here](https://huggingface.co/course/chapter7/4?fw=pt), however, I am getting this error `Key Error ‘loss’`  
the input to the model :

```auto
DatasetDict({
    train: Dataset({
        features: ['attention_mask', 'input_ids', 'labels', 'src', 'token_type_ids', 'trg'],
        num_rows: 40
    })
    validation: Dataset({
        features: ['attention_mask', 'input_ids', 'labels', 'src', 'token_type_ids', 'trg'],
        num_rows: 11
    })
})

```

Note: when I run `trainer.train()` , it returns a message like `The following columns in the training set don't have a corresponding argument in `BertModel.forward` and have been ignored: trg, labels, src.`

any hints?

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [December 23, 2021, 4:23pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkey-error-loss-finetuning-arabert-mbert%2F13052%2F2 "2021-12-23T16:23:03Z")

</div>

You can use the `Trainer` on `BertModel` as it has no objective, it’s the body of the model with no particular head. You should pick a model with a head suitable for the task at hand.
