Key Error 'loss' while fine tuning GPT-2 with the Trainer utility

sgugger
Thu, 17 Dec 2020 14:01:17 +0000

If you have this error, it’s probably because you are not passing any labels to your model. It’s hard to know for sure since you don’t explain how you built your dataset.