AttributeError                            Traceback (most recent call last)
<ipython-input-21-3435b262f1ae> in <module>()
----> 1 trainer.train()

7 frames
/usr/local/lib/python3.7/dist-packages/transformers/trainer.py in train(self, resume_from_checkpoint, trial, **kwargs)
    987 
    988             self.control = self.callback_handler.on_epoch_end(self.args, self.state, self.control)
--> 989             self._maybe_log_save_evaluate(tr_loss, model, trial, epoch)
    990 
    991             if self.args.tpu_metrics_debug or self.args.debug:

/usr/local/lib/python3.7/dist-packages/transformers/trainer.py in _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch)
   1056         metrics = None
   1057         if self.control.should_evaluate:
-> 1058             metrics = self.evaluate()
   1059             self._report_to_hp_search(trial, epoch, metrics)
   1060 

/usr/local/lib/python3.7/dist-packages/transformers/trainer.py in evaluate(self, eval_dataset, ignore_keys, metric_key_prefix)
   1511             prediction_loss_only=True if self.compute_metrics is None else None,
   1512             ignore_keys=ignore_keys,
-> 1513             metric_key_prefix=metric_key_prefix,
   1514         )
   1515 

/usr/local/lib/python3.7/dist-packages/transformers/trainer.py in prediction_loop(self, dataloader, description, prediction_loss_only, ignore_keys, metric_key_prefix)
   1628 
   1629         for step, inputs in enumerate(dataloader):
-> 1630             loss, logits, labels = self.prediction_step(model, inputs, prediction_loss_only, ignore_keys=ignore_keys)
   1631             if loss is not None:
   1632                 losses = loss.repeat(batch_size)

/usr/local/lib/python3.7/dist-packages/transformers/trainer.py in prediction_step(self, model, inputs, prediction_loss_only, ignore_keys)
   1760 
   1761         if has_labels:
-> 1762             labels = nested_detach(tuple(inputs.get(name) for name in self.label_names))
   1763             if len(labels) == 1:
   1764                 labels = labels[0]

/usr/local/lib/python3.7/dist-packages/transformers/trainer_pt_utils.py in nested_detach(tensors)
    109     "Detach `tensors` (even if it's a nested list/tuple of tensors)."
    110     if isinstance(tensors, (list, tuple)):
--> 111         return type(tensors)(nested_detach(t) for t in tensors)
    112     return tensors.detach()
    113 

/usr/local/lib/python3.7/dist-packages/transformers/trainer_pt_utils.py in <genexpr>(.0)
    109     "Detach `tensors` (even if it's a nested list/tuple of tensors)."
    110     if isinstance(tensors, (list, tuple)):
--> 111         return type(tensors)(nested_detach(t) for t in tensors)
    112     return tensors.detach()
    113 

/usr/local/lib/python3.7/dist-packages/transformers/trainer_pt_utils.py in nested_detach(tensors)
    110     if isinstance(tensors, (list, tuple)):
    111         return type(tensors)(nested_detach(t) for t in tensors)
--> 112     return tensors.detach()
    113 
    114 

AttributeError: 'NoneType' object has no attribute 'detach'