Hello,
I tried your code and did not get any errors. Is there another place where you call images, labels = dataiter.next()? Also, what is your PyTorch and Torchvision versions?
And one last thing, why do you divide your images by 255 on the last line?