UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead

UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead

在这里插入图片描述
代码中原先是
在这里插入图片描述
需要改成:
在这里插入图片描述
应该是torch的版本问题所导致的。

你可能感兴趣的:(报错bug,bug,pytorch,深度学习,神经网络)