【python】解决AttributeError: module ‘scipy.misc‘ has no attribute ‘toimage‘问题
程序员文章站
2022-10-27 19:46:46
〇、前情提要在b站跟着up主 白手起家的百万富翁 学mnist手写体识别实践,但到了scipy.misc.toimage(image_array, cmin=0.0, cmax=1.0).save(image_file)报错AttributeError: module 'scipy.misc' has no attribute 'toimage'。参考:我的笔记-AttributeError: module ‘scipy.misc’ has no attribute ‘toimage’ht...
〇、前情提要
在b站跟着up主 白手起家的百万富翁 学mnist手写体识别实践,但到了scipy.misc.toimage(image_array, cmin=0.0, cmax=1.0).save(image_file)
报错AttributeError: module 'scipy.misc' has no attribute 'toimage'
。
参考:
- 我的笔记-【TensorFlow】线性加权法-mnist手写体识别实践 笔记
https://blog.csdn.net/weixin_43210113/article/details/107667417 - AttributeError: module ‘scipy.misc’ has no attribute ‘toimage’
https://blog.csdn.net/lwc5411117/article/details/100654865?biz_id=102&utm_term=module%20scipy.misc%20has%20no%20attri&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-0-100654865&spm=1018.2118.3001.4187
一、问题发现
源代码
scipy.misc.toimage(image_array, cmin=0.0, cmax=1.0).save(image_file)
报错
AttributeError: module 'scipy.misc' has no attribute 'toimage'
二、方法一-降低scipy版本至1.1.0
找到环境,查找scipy版本
右键选择新版本
降级完毕
三、方法二-调用Pillow函数
引用
AttributeError: module ‘scipy.misc’ has no attribute ‘toimage’
https://blog.csdn.net/lwc5411117/article/details/100654865?biz_id=102&utm_term=module%20scipy.misc%20has%20no%20attri&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-0-100654865&spm=1018.2118.3001.4187
本文地址:https://blog.csdn.net/weixin_43210113/article/details/107673559
推荐阅读
-
AttributeError: module ‘community‘ has no attribute ‘best_partition‘ 问题解决方法
-
【python】解决AttributeError: module ‘scipy.misc‘ has no attribute ‘toimage‘问题
-
python efficientdet AttributeError: module ‘gast‘ has no attribute ‘Num‘
-
Python AttributeError: 'Module' object has no attribute 'STARTF_USESHOWINDOW'
-
运行sqlmap提示AttributeError: 'module' object has no attribute 'HTTPSHandler'解决方法
-
解决pycharm问题:module 'pip' has no attribute 'main'
-
python报错:AttributeError: 'module' object has no attribute 'xfeatures2d'
-
AttributeError: module ‘community‘ has no attribute ‘best_partition‘ 问题解决方法
-
AttributeError: module ‘tensorflow’ has no attribute ‘compat’,安装tensorflow-gpu=2.0.0出现的问题
-
python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法