1.
molded_images = Variable(molded_images, volatile=True)
運行提示:UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
# Wrap in variable
with torch.no_grad():
molded_images = Variable(molded_images)
2.
loss.data[0]
替換爲
loss.item()