AttributeError: module ‘scipy.misc‘ has no attribute ‘imsave‘ | 有效解决

  • 🥇 版权: 本文由【墨理学AI】原创、在CSDN首发、各位大佬、敬请查阅
  • 🎉 声明: 作为全网 AI 领域 干货最多的博主之一,❤️ 不负光阴不负卿 ❤️
  • ❤️ 如果文章对你有帮助、欢迎一键三连
  • 🍖 本博文重点在于,提供解决该问题的思路


1-0


📔 AttributeError: module ‘scipy.misc’ has no attribute ‘imsave’


遇到报错

AttributeError: module 'scipy.misc' has no attribute 'imsave'

遇到这个报错,两种思路

  • 一:修改代码中相关函数名字为当前版本函数名
  • 二:降低 scipy 到合适版本

简单起见,这里暂采用 降版本的方式

# 使用 conda 搜寻可以安装的版本

conda search scipy

Loading channels: done
# Name                       Version           Build  Channel             
scipy                         0.19.1 py27_nomklhda24f63_3  pkgs/main           
scipy                         0.19.1  py27h1edc525_3  pkgs/main           
scipy                         0.19.1 py35_nomklh614202b_3  pkgs/main           
scipy                         0.19.1  py35ha8f041b_3  pkgs/main           
scipy                         0.19.1 py36_nomklh59deb5f_3  pkgs/main           
scipy                         0.19.1  py36h9976243_3  pkgs/main           
scipy                          1.0.0 py27_nomklhc4f40eb_0  pkgs/main           
scipy                          1.0.0  py27hf5f0f52_0  pkgs/main           
scipy                          1.0.0 py35_nomklhb72a26a_0  pkgs/main           
scipy                          1.0.0  py35hcbbe4a2_0  pkgs/main           
scipy                          1.0.0 py36_nomklh9d91e6a_0  pkgs/main           
scipy                          1.0.0  py36hbf646e7_0  pkgs/main           
scipy                          1.0.1 py27_nomklh9d22d0a_0  pkgs/main           
scipy                          1.0.1  py27hfc37229_0  pkgs/main           
scipy                          1.0.1 py35_nomklh9d22d0a_0  pkgs/main           
scipy                          1.0.1  py35hfc37229_0  pkgs/main           
scipy                          1.0.1 py36_nomklh9d22d0a_0  pkgs/main           
scipy                          1.0.1  py36hfc37229_0  pkgs/main           
scipy                          1.1.0 py27_nomklh9c1e066_0  pkgs/main           
scipy                          1.1.0 py27_nomklh9d22d0a_0  pkgs/main           
scipy                          1.1.0 py27_nomklhb74e8f7_0  pkgs/main           
scipy                          1.1.0  py27h7c811a0_2  pkgs/main           
scipy                          1.1.0  py27h9b217d5_1  pkgs/main           
scipy                          1.1.0  py27hc49cb51_0  pkgs/main           
scipy                          1.1.0  py27hd20e5f9_0  pkgs/main           
scipy                          1.1.0  py27he2b7bc3_1  pkgs/main           
scipy                          1.1.0  py27he2b7bc3_2  pkgs/main           
scipy                          1.1.0  py27hfa4b5c9_1  pkgs/main           
scipy                          1.1.0  py27hfc37229_0  pkgs/main           
scipy                          1.1.0 py35_nomklh9d22d0a_0  pkgs/main           
scipy                          1.1.0  py35h9b217d5_1  pkgs/main           
scipy                          1.1.0  py35hd20e5f9_0  pkgs/main           
scipy                          1.1.0  py35he2b7bc3_1  pkgs/main           
scipy                          1.1.0  py35hfa4b5c9_1  pkgs/main           
scipy                          1.1.0  py35hfc37229_0  pkgs/main           
scipy                          1.1.0 py36_nomklh9c1e066_0  pkgs/main           
scipy                          1.1.0 py36_nomklh9d22d0a_0  pkgs/main           
scipy                          1.1.0  py36h7c811a0_2  pkgs/main           
scipy                          1.1.0  py36h9b217d5_1  pkgs/main           
scipy                          1.1.0  py36hc49cb51_0  pkgs/main           
scipy                          1.1.0  py36hd20e5f9_0  pkgs/main           
scipy                          1.1.0  py36he2b7bc3_1  pkgs/main           
scipy                          1.1.0  py36he2b7bc3_2  pkgs/main           
scipy                          1.1.0  py36hfa4b5c9_1  pkgs/main           
scipy                          1.1.0  py36hfc37229_0  pkgs/main           
scipy                          1.1.0 py37_nomklh9c1e066_0  pkgs/main           
scipy                          1.1.0  py37h7c811a0_2  pkgs/main           
scipy                          1.1.0  py37h9b217d5_1  pkgs/main           
scipy                          1.1.0  py37hc49cb51_0  pkgs/main           
scipy                          1.1.0  py37he2b7bc3_1  pkgs/main           
scipy                          1.1.0  py37he2b7bc3_2  pkgs/main           
scipy                          1.1.0  py37hfa4b5c9_1  pkgs/main           
scipy                          1.2.0  py27h7c811a0_0  pkgs/main           
scipy                          1.2.0  py27he2b7bc3_0  pkgs/main           
scipy                          1.2.0  py36h7c811a0_0  pkgs/main           
scipy                          1.2.0  py36he2b7bc3_0  pkgs/main           
scipy                          1.2.0  py37h7c811a0_0  pkgs/main           
scipy                          1.2.0  py37he2b7bc3_0  pkgs/main           
scipy                          1.2.1  py27h7c811a0_0  pkgs/main           
scipy                          1.2.1  py27he2b7bc3_0  pkgs/main           
scipy                          1.2.1  py36h7c811a0_0  pkgs/main           
scipy                          1.2.1  py36he2b7bc3_0  pkgs/main           
scipy                          1.2.1  py37h7c811a0_0  pkgs/main           
scipy                          1.2.1  py37he2b7bc3_0  pkgs/main           
scipy                          1.3.0  py36h7c811a0_0  pkgs/main           
scipy                          1.3.0  py36he2b7bc3_0  pkgs/main           
scipy                          1.3.0  py37h7c811a0_0  pkgs/main           
scipy                          1.3.0  py37he2b7bc3_0  pkgs/main           
scipy                          1.3.1  py36h7c811a0_0  pkgs/main           
scipy                          1.3.1  py36he2b7bc3_0  pkgs/main           
scipy                          1.3.1  py37h7c811a0_0  pkgs/main           
scipy                          1.3.1  py37he2b7bc3_0  pkgs/main           
scipy                          1.3.1  py38h7c811a0_0  pkgs/main           
scipy                          1.3.1  py38he2b7bc3_0  pkgs/main           
scipy                          1.3.2  py36h7c811a0_0  pkgs/main           
scipy                          1.3.2  py36he2b7bc3_0  pkgs/main           
scipy                          1.3.2  py37h7c811a0_0  pkgs/main           
scipy                          1.3.2  py37he2b7bc3_0  pkgs/main           
scipy                          1.3.2  py38h7c811a0_0  pkgs/main           
scipy                          1.3.2  py38he2b7bc3_0  pkgs/main           
scipy                          1.4.1  py36h0b6359f_0  pkgs/main           
scipy                          1.4.1  py36habc2bb6_0  pkgs/main           
scipy                          1.4.1  py37h0b6359f_0  pkgs/main           
scipy                          1.4.1  py37habc2bb6_0  pkgs/main           
scipy                          1.4.1  py38h0b6359f_0  pkgs/main           
scipy                          1.4.1  py38habc2bb6_0  pkgs/main           
scipy                          1.5.0  py36h0b6359f_0  pkgs/main           
scipy                          1.5.0  py36habc2bb6_0  pkgs/main           
scipy                          1.5.0  py37h0b6359f_0  pkgs/main           
scipy                          1.5.0  py37habc2bb6_0  pkgs/main           
scipy                          1.5.0  py38h0b6359f_0  pkgs/main           
scipy                          1.5.0  py38habc2bb6_0  pkgs/main           
scipy                          1.5.2  py36h0b6359f_0  pkgs/main           
scipy                          1.5.2  py36habc2bb6_0  pkgs/main           
scipy                          1.5.2  py37h0b6359f_0  pkgs/main           
scipy                          1.5.2  py37habc2bb6_0  pkgs/main           
scipy                          1.5.2  py38h0b6359f_0  pkgs/main           
scipy                          1.5.2  py38habc2bb6_0  pkgs/main           
scipy                          1.5.2  py39h91f5cce_0  pkgs/main           
scipy                          1.5.2  py39hf56f3a7_0  pkgs/main           
scipy                          1.6.0  py37h91f5cce_0  pkgs/main           
scipy                          1.6.0  py37hf56f3a7_0  pkgs/main           
scipy                          1.6.0  py38h91f5cce_0  pkgs/main           
scipy                          1.6.0  py38hf56f3a7_0  pkgs/main           
scipy                          1.6.0  py39h91f5cce_0  pkgs/main           
scipy                          1.6.0  py39hf56f3a7_0  pkgs/main           
scipy                          1.6.1  py37h91f5cce_0  pkgs/main           
scipy                          1.6.1  py37hf56f3a7_0  pkgs/main           
scipy                          1.6.1  py38h91f5cce_0  pkgs/main           
scipy                          1.6.1  py38hf56f3a7_0  pkgs/main           
scipy                          1.6.1  py39h91f5cce_0  pkgs/main           
scipy                          1.6.1  py39hf56f3a7_0  pkgs/main           
scipy                          1.6.2  py37h91f5cce_0  pkgs/main           
scipy                          1.6.2  py37had2a1c9_1  pkgs/main           
scipy                          1.6.2  py37hf56f3a7_0  pkgs/main           
scipy                          1.6.2  py37hf56f3a7_1  pkgs/main           
scipy                          1.6.2  py38h91f5cce_0  pkgs/main           
scipy                          1.6.2  py38had2a1c9_1  pkgs/main           
scipy                          1.6.2  py38hf56f3a7_0  pkgs/main           
scipy                          1.6.2  py38hf56f3a7_1  pkgs/main           
scipy                          1.6.2  py39h91f5cce_0  pkgs/main           
scipy                          1.6.2  py39had2a1c9_1  pkgs/main           
scipy                          1.6.2  py39hf56f3a7_0  pkgs/main           
scipy                          1.6.2  py39hf56f3a7_1  pkgs/main           
scipy                          1.7.1  py37h292c36d_2  pkgs/main           
scipy                          1.7.1  py37hc65b3f8_2  pkgs/main           
scipy                          1.7.1  py38h292c36d_2  pkgs/main           
scipy                          1.7.1  py38hc65b3f8_2  pkgs/main           
scipy                          1.7.1  py39h292c36d_2  pkgs/main           
scipy                          1.7.1  py39hc65b3f8_2  pkgs/main    


📕 卸载当前版本


# 之前是 pip 安装,就用 pip 卸载

pip uninstall scipy

Found existing installation: scipy 1.5.4
Uninstalling scipy-1.5.4:
  Would remove:
    /home/zql/anaconda3/envs/torch04/lib/python3.6/site-packages/scipy-1.5.4.dist-info/*
    /home/zql/anaconda3/envs/torch04/lib/python3.6/site-packages/scipy.libs/libgfortran-ed201abd.so.3.0.0
    /home/zql/anaconda3/envs/torch04/lib/python3.6/site-packages/scipy.libs/libopenblasp-r0-085ca80a.3.9.so
    /home/zql/anaconda3/envs/torch04/lib/python3.6/site-packages/scipy/*
Proceed (Y/n)? y
  Successfully uninstalled scipy-1.5.4




📗 安装低版本


具体安装命令为【成功解决】

conda install scipy=0.19.1

📘 更多有效教程


计算机视觉、超分重建、图像修复、目标检测、模型部署等方向小伙伴可简单交流

此次博文内容难以 以偏概全,如有不恰当的地方,欢迎评论区批评指正


对于即将入行计算机视觉的小伙伴,墨理这里推荐收藏的干货博文目前如下

5-0

  • 👋 博主的其他几个专栏也有不少干货,不然也不会有数百位本、硕、博研究圈子小伙伴的关注和订阅 欢迎查阅更多专栏博文 ~

专栏博文保质保量,感谢各位小伙伴点赞、评论鼓励博主的每一分认真创作


❤️ 人生苦短, 欢迎和墨理一起学AI


  • 🎉 作为全网 AI 领域 干货最多的博主之一,❤️ 不负光阴不负卿 ❤️
  • ❤️ 如果文章对你有帮助、不要忘了、评论鼓励三连

9-9

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

墨理学AI

不必打赏,关注博主公众号即可

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

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

打赏作者

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

抵扣说明:

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

余额充值