导入torchvision出现:AttributeError: module ‘torch.jit‘ has no attribute ‘unused‘错误

导入torchvision出现:AttributeError: module 'torch.jit' has no attribute 'unused'错误

文章目录:


我的本机环境:

  • windows10系统
  • torch==1.2.0+cu92
  • torchvision== 0.6.1+cu92

1 问题原因

我本机已经安装了torch==1.2.0+cu92版本,后面开始安装torchvision==0.6.1+cu92,成功安装并且没有出任何错误,但是在导入import torchvision的时候报错:AttributeError: module 'torch.jit' has no attribute 'unused'

网上参考很多,都是说由于torchtorchvision的 版本导致的该错误。

2 解决方法

安装torch版本为1.4.0

pip install torch==1.4.0 -f https://download.pytorch.org/whl/torch_stable.html

安装torchvision版本为0.5.0

pip install torchvision==0.5.0 -f https://download.pytorch.org/whl/torch_stable.html

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_41010198/article/details/107156229