AttributeError: module 'torch.cpu' has no attribute 'set_device'

AttributeError: module 'torch.cpu' has no attribute 'set_device' 是哪里出了问题怎么解决

img


img


img

可能是版本更新导致的 方法缺失 建议查询源代码 所用torch 版本 或者 寻找set_device的替代方法

模块“torch.cpu”没有属性“set_device”,升级 一下pytorch

【相关推荐】




如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^