Open
Description
When extracting and showing MNIST, we get
'_SingleProcessDataLoaderIter' object has no attribute 'next'
According to this stackoverflow post, iter(...).next()
is deprecated starting from pytorch 1.13, released in October 2022. I can fix this with this change:
" sampler=ChunkSampler(NUM_VAL, NUM_TRAIN)\n",
")\n",
"\n",
- "imgs = loader_train.__iter__().next()[0].view(batch_size, 784).numpy().squeeze()\n",
+ "i = loader_train.__iter__()\n",
+ "imgs = next(i)[0].view(batch_size, 784).numpy().squeeze()\n",
"show_images(imgs)"
]
},
(diff looks kinda weird for jupyter notebooks, but I think it gets the point across.)
Metadata
Metadata
Assignees
Labels
No labels