I'm getting "nan" value for loss, while following a tutorial from the documentation
# ❓ Questions & Help


## Details
Hi,

I’m following the “Fine-tuning with Custom Dataset” tutorial for Question Answering on the SQuaD dataset tutorial: [available here](https://huggingface.co/transformers/custom_datasets.html#question-answering-with-squad-2-0). I’ve copy-pasted all the code shown in the tutorial step by step. However, when my model starts training, I don’t get the expected metric values for loss as I normally would, instead I get “nan”. Here is the code for training
`model.fit(train_dataset.shuffle(1000).batch(16), epochs=3, batch_size=16)`

Here is the output with the "nan" values for the losses.
```
Epoch 1/3
5427/5427 [==============================] - 4604s 848ms/step - loss: nan - output_1_loss: nan - output_2_loss: nan
Epoch 2/3
365/5427 [=>…] - ETA: 1:11:28 - loss: nan - output_1_loss: nan - output_2_loss: nan

```
I don’t know what is wrong, and I don’t think this output is what is supposed to be.

Would appreciate any help with this regard.
Thank you.


**A link to original question on the forum/Stack Overflow**:
https://discuss.huggingface.co/t/im-getting-nan-value-for-loss-while-following-a-tutorial-from-the-documentatin/1530
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
<|||||>@sunnyville01 
hi, facing the same issue, did you manage to solve this?