bentrevett/pytorch-sentiment-analysis

2 - Upgraded Sentiment Analysis: TypeError: '<' not supported between instances of 'Example' and 'Example'

junthbasnet opened this issue · 3 comments

When working on the multiclass classification problem, TypeError: '<' not supported between instances of 'Example' and 'Example' has occurred. It has to do with BucketIterator sortkey or something.
BucketIterator

Are you using a custom dataset?

Yes, I figured that out, using sort_key in BucketIterator solves that problem but I think it lead to another error.
RuntimeError: Length of all samples has to be greater than 0, but found an element in 'lengths' that is <= 0.