my dataset has the labels, but also get a KeyError: ‘loss’
>>> d = next(iter(train_loader))
>>> d.keys()
dict_keys(['input_ids', 'attention_mask', 'labels'])
>>>
now exiting InteractiveConsole...
[INFO|trainer.py:1202] 2021-12-03 18:24:14,156 >> ***** Running training *****
[INFO|trainer.py:1203] 2021-12-03 18:24:14,156 >>   Num examples = 6667
[INFO|trainer.py:1204] 2021-12-03 18:24:14,156 >>   Num Epochs = 3
[INFO|trainer.py:1205] 2021-12-03 18:24:14,156 >>   Instantaneous batch size per device = 1
[INFO|trainer.py:1206] 2021-12-03 18:24:14,157 >>   Total train batch size (w. parallel, distributed & accumulation) = 1
[INFO|trainer.py:1207] 2021-12-03 18:24:14,157 >>   Gradient Accumulation steps = 1
[INFO|trainer.py:1208] 2021-12-03 18:24:14,157 >>   Total optimization steps = 20001
  0%|                                                                                                                                                         | 0/20001 [00:00<?, ?it/s]Traceback (most recent call last):
  File "run_train.py", line 90, in <module>
    main()
  File "run_train.py", line 85, in main
    trainer.train()
  File "/usr/local/anaconda3/lib/python3.7/site-packages/transformers/trainer.py", line 1323, in train
    tr_loss_step = self.training_step(model, inputs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/transformers/trainer.py", line 1861, in training_step
    loss = self.compute_loss(model, inputs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/transformers/trainer.py", line 1905, in compute_loss
    loss = outputs["loss"] if isinstance(outputs, dict) else outputs[0]
  File "/usr/local/anaconda3/lib/python3.7/site-packages/transformers/file_utils.py", line 2125, in __getitem__
    return inner_dict[k]
KeyError: 'loss'

@sgugger is there any advice?