pythont提示AttributeError: module ‘scipy.misc‘ has no attribute ‘imsave‘或‘imread‘

在使用PyTorch进行VGG16模型的特征图可视化过程中,遇到了安装库冲突的问题。尝试降低scipy版本到1.2.0,但依然报错。最终通过下载scipy-1.2.1的特定Python3.6版本的whl文件,离线安装解决了问题,使得代码能够正常运行。
摘要由CSDN通过智能技术生成

本人在使用pytorch进行vgg16特征图可视化画图时碰到了以上问题,查询解决方法时很多建议 pip install Pillow 但是我这里输入后显示已经安装,而且还是报错,显然不是这个问题。后来发现是scipy库版本较高,建议降到1.2.0版本,我输入如下指令后:

pip install scipy==1.2.0

Installing collected packages: scipy
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

albumentations 0.4.2 requires imgaug<0.2.7,>=0.2.5, which is not installed.
imagecorruptions 1.1.0 requires scipy>=1.2.1, but you'll have scipy 1.2.0 which is incompatible.
Successfully installed scipy-1.2.0

发现1.2.0版本安装仍然报错,有部分功能无法使用,而且使用命令行安装出现了一些问题,运行python代码任然报错,于是我继续调整合适的scipy1.2.1的python3.6版本,并且使用离线下载。

离线下载需要进入其官方下载网站:https://pypi.org/project/scipy/1.2.1/#files(这是1.2.1版本),找到需要下载的文件:scipy-1.2.1-cp36-cp36m-manylinux1_x86_64.whl 下载完成后,从命令行进入存放.whl文件的位置,运行安装指令:

pip install scipy-1.2.1-cp36-cp36m-manylinux1_x86_64.whl

安装完成后,继续运行python代码,就没有报错了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清梦枕星河~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值