fast-bert
fast-bert copied to clipboard
ValueError: Target size (torch.Size([9, 4])) must be the same as input size (torch.Size([12, 4]))
I am doing multi-label classification. Getting this error !
There's not enough information here to pursue this.
that is because ur sample size can not evenly divide the batch size, try to set drop_last=True, for your Pytorch Dataloader here: https://github.com/kaushaltrivedi/fast-bert/blob/master/fast_bert/data_cls.py#L460 for all train , validation and test.