UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
molded_images = Variable(molded_images, volatile=True)
修改为
# Wrap in variable
with torch.no_grad():
molded_images = Variable(molded_images)
即可