解决:AttributeError: '_SingleProcessDataLoaderIter' object has no attribute 'next'
在使用以下代码查看数据集中的图象时,
test_image, test_label = test_data_iter.next()
程序报错如下:
Traceback (most recent call last):
File "train.py", line 107, in <module>
test_image, test_label = test_data_iter.next()
AttributeError: '_SingleProcessDataLoaderIter' object has no attribute 'next'
解决方法:将上面一行代码修改成以下代码即可
test_image, test_label = next(test_data_iter)