Help,my BucketIterator doesn't work

I creat a BucketIterator from my train_set.
But when I begin my training ,the BucketIterator object doesn’t work :
“for batch in train_iterator:”---------my code
it said that “object of type ‘numpy.int64’ has no len()”

detailed code as follows:

I recommend you debug the code step by step. You also have to know that data processing using torchtext has been heavily discussed here torchtext issue. You can follow the migration tutorial from torctext data processing to something better Migrate torchtext from the legacy API to the new API