# Key Error "loss"

**URL:** <https://discuss.huggingface.co/t/key-error-loss/19896>\
**Category:** Models\
**Created:** [July 1, 2022, 10:53am UTC](https://discuss.huggingface.co/t/key-error-loss/19896 "2022-07-01T10:53:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robbespo](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/robbespo/32/5253_2.png) [@robbespo](https://discuss.huggingface.co/u/robbespo)\
**Post date:** [July 1, 2022, 10:53am UTC](https://discuss.huggingface.co/t/key-error-loss/19896/1 "2022-07-01T10:53:47Z")

</div>

Hi everyone,  
I am having issue when I try to fine tune a pre-trained model. In particular I am trying to use OPT model by Meta to perform NMT. First of all I created the tokenizer and following the instructions of the documentation I used the AutoTokenizer (with flag, use\_fast=False) or GPT2Tokenizer. Then I use Seq2SeqTrainer and when I try to train the model I get the error Key Loss “loss”.

Reading the other topics on the forum I have seen that the problem can be that I do not have the labels of the dataset, but in reality I have them.

Furthermore I upload the notebook related to the problem that can be viewed by everyone.  
Link Notebook: [translation.ipynb - Google Drive](https://drive.google.com/file/d/1jNob6y4KY-Cr-2A75IgjJG4zajwmnYod/view?usp=sharing)

 ![Screen Shot 2022-07-01 at 12.52.18 PM](https://us1.discourse-cdn.com/hellohellohello/original/2X/6/601950879e68994cbc55ff467739a86f5054e561.jpeg)
