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)
1. 其他的因为版本变动问题:
UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument. return F.log_softmax(x)
解决方法:把 F.log_softmax(x)改为F.log_softmax(x,dim=0) , 而且我发现改为F.log_softmax(x,dim=1),这个到底哪个更合理需要进一步确认。
2.
UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.