zergtant / pytorch-handbook

pytorch handbook是一本开源的书籍,目标是帮助那些希望和使用PyTorch进行深度学习开发和研究的朋友快速入门,其中包含的Pytorch教程全部通过测试保证可以成功运行
20.1k stars 5.39k forks source link

ch1训练一个分类器一节中iter的next()用法有误 #140

Open PhilipGAQ opened 1 year ago

PhilipGAQ commented 1 year ago

原文使用 images,labels=dataiter.next() 出现报错: AttributeError: '_MultiProcessingDataLoaderIter' object has no attribute 'next' 应更正为 images, labels = next(dataiter)

ldwDavid commented 8 months ago

没错,估计是库的更新导致的,修改为next(dataiter)后能正常运行