AttributeError: Can't get attribute '_rebuild_parameter' on module 'torch._utils'

调用 torch.load()会出现下面的错误

Can't get attribute '_rebuild_parameter' on <module 'torch._utils

可以查看是由于torch版本的不匹配造成的,如果是版本问题先卸载torch

pip uninstall torch

然后在https://www.lfd.uci.edu/~gohlke/pythonlibs/? ?上下载与自己环境相匹配的版本

我的环境是python36版本,win64,使用的?torch?1.0.0?cp36?cp36m?win_amd64.whl,下载torch?1.0.0?cp36?cp36m?win_amd64.whl,随意放到一个路径,例如放到d盘,则

pip install d:/torch?1.0.0?cp36?cp36m?win_amd64.whl
 

猜你喜欢

转载自blog.csdn.net/u014742995/article/details/85985000
今日推荐