kmkurn / pytorch-crf

(Linear-chain) Conditional random field in PyTorch.
https://pytorch-crf.readthedocs.io
MIT License
935 stars 151 forks source link

raise ValueError('mask of the first timestep must all be on') #61

Closed anjani-dhrangadhariya closed 4 years ago

anjani-dhrangadhariya commented 4 years ago

What exactly does this ValueError mean? This is the mask tensor (dim: [6, 512]) I am using

tensor([[0, 1, 1,  ..., 0, 0, 0],
        [0, 1, 0,  ..., 1, 1, 0],
        [0, 1, 1,  ..., 0, 0, 0],
        [0, 1, 1,  ..., 0, 0, 0],
        [0, 1, 1,  ..., 1, 1, 0],
        [0, 1, 1,  ..., 0, 0, 0]], dtype=torch.uint8)

I assume it means that all the 6 tensors (dim 1) should begin with value 1 and not 0.

anjani-dhrangadhariya commented 4 years ago

Yes, it is exactly what I put in the question. All the tensors should begin with a non-zero/False mask value.

pratikchhapolika commented 1 year ago

@anjani-dhrangadhariya I also get the same error:

0%|          | 3/62500 [00:01<5:18:57,  3.27it/s] 

ValueError: mask of the first timestep must all be on

I am training BERT-CRF model. How to solve this error?