It’s something related to batching. Most probably because all images are not of the same size.
Create transforms to make them constant size. You can checkout tutorial on transforms here: http://pytorch.org/tutorials/beginner/data_loading_tutorial.html 412