AttributeError: 'BucketIterator' object has no attribute 'i'

I’m doing seq2seq machine translation on my own dataset. I have preproceed my dataset using this code. The problem comes when i tried to split train_data using BucketIterator.split()

I am very confuse, because i don’t know what key i should use for train iterator. Thank you for your help

Try changing print(data.i) to print(data). That should give you some ideas on the names involved.

@gphilip Thank you for your response. I have tried, but it makes me more confuse
image

Asking Google about “torchtext BucketIterator” threw up this tutorial. You may find it useful.

1 Like