DeepSpeedExamples
DeepSpeedExamples copied to clipboard
AttributeError: '_MultiProcessingDataLoaderIter' object has no attribute 'next'
Bug report.
When executing python cifar10_tutorial.py
,
it shows AttributeError: '_MultiProcessingDataLoaderIter' object has no attribute 'next'
.
One more thing is that.
pip install -r requirements.txt
it shows below
ERROR: No matching distribution found for torchvision==0.4.0
My system version is same as below Python 3.8.13 Torch 1.13.0a0+d0d6b1f
The code needs to be fixed. Change from:
images, labels = dataiter.next()
to:
images, labels = next(dataiter)
This works.
In deep learning, data is usually processed in batches. The line images, labels = next(dataiter) is used to retrieve the next batch of data for processing. below also works if you have iter through_tain loader for batch_idx, (data, target) in enumerate(train_loader): metax, mask = next(metaloader)
The dataiter object is an iterator that has been initialized with a dataset, and next() is called on it to retrieve the next batch of data. The batch is divided into two variables: images and labels