It’s hard to read the code in my phone.
maybe you can use markdown to beautify your code.
and you need
net.eval()
before output=net(image)
also make sure you have the same preprocessing for images during training and validate period