monologg/JointBERT

IndexError: Target 10 is out of bounds.

iampabba opened this issue · 1 comments

I am testing JointBERT for my own dataset. I face the below issue.

Can someone help me in resolving this? What might be the reason for the error?

Traceback (most recent call last):
  File "main.py", line 72, in <module>
    main(args)
  File "main.py", line 20, in main
    trainer.train()
  File "/home/ubuntu/JointBERT/trainer.py", line 87, in train
    outputs = self.model(**inputs)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/ubuntu/JointBERT/model/modeling_jointbert.py", line 44, in forward
    intent_loss = intent_loss_fct(intent_logits.view(-1, self.num_intent_labels), intent_label_ids.view(-1))
  File "/home/ubuntu/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 916, in forward
    ignore_index=self.ignore_index, reduction=self.reduction)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 2021, in cross_entropy
    return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 1838, in nll_loss
    ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
IndexError: Target 10 is out of bounds.

I've resolved the issue after clearing all the cache files created from the previous training and it worked.