# Unable to Finetune Deberta

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funable-to-finetune-deberta%2F25006%3E%5C
**Category:** Intermediate\
**Created:** [October 26, 2022, 11:16am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funable-to-finetune-deberta%2F25006 "2022-10-26T11:16:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manujmalik](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@manujmalik](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmanujmalik)%5C
**Post date:** [October 26, 2022, 11:16am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funable-to-finetune-deberta%2F25006%2F1 "2022-10-26T11:16:27Z")

</div>

I am trying to finetune deberta for irony detection task, colab’s notebook link can be found [here](https://colab.research.google.com/drive/1mZI5W2ozc8speZiwzOtCrWABhSaxqhWD?usp=sharing)

When I try to use ‘microsoft/deberta-v3-base’ checkpoint with AutoModel, I’m getting the following error :

```auto
RuntimeError: Expected target size [32, 2], got [32]

```

but when I use the same model with ‘bert-base-uncased’ or roberta (with some changes in head) it works fine. The one can find working code for bert based in [this](https://colab.research.google.com/drive/1PXacY2YgAfk6IYC0sAynp88Z6ndWrqYQ?usp=sharing) notebook.

When I printed the shapes of predictions and labels, I got outputs as torch.Size([32, 30, 2]), torch.Size([32]) respectively. In the case of bert, shapes of outputs were torch.Size([32, 2]), torch.Size([32]) for predictions and labels.

Here 32 is the batch size, and 30 is the sequence length.

Can someone let me know what I’m doing wrong?
