Thanks for the error message.
It looks like you are indexing your images twice at dim0.
In your eval loop, you are calling imshow(inputs.data[j]), which gets the jth image in the current batch, and then again in imshow you are calling img[0].
It looks like the indexing in imshow could be removed.
Could you check that and see, if it’s running?