cannot import name 'imsave' from 'scipy.misc'
时间: 2023-08-29 16:09:37 浏览: 220
问题中提到了无法从'scipy.misc'中导入'imsave'函数。根据引用中的内容,这个问题可能是由于最新版本的SciPy中移除了'imsave'函数导致的。为了解决这个问题,可以尝试使用其他替代的函数或方法。一个可行的解决方案是使用OpenCV的'cv2.imwrite'函数来代替'scipy.misc.imsave'函数。可以按照引用中提供的链接和说明,将'imsave'函数替换为'cv2.imsave'函数。这样可以确保代码在没有降级SciPy的情况下正常运行。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [from scipy.misc import imsave报错ImportError: cannot import name ‘imsave‘ from ‘scipy.misc](https://blog.csdn.net/weixin_43407319/article/details/115566098)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [无需降级scipy的情况下解决AttributeError: module ‘scipy.misc’ has no attribute ‘imread’,imresize...](https://download.csdn.net/download/weixin_38701640/13745210)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [(亲测有效)ImportError: cannot import name ‘imsave‘ from ‘scipy.misc](https://blog.csdn.net/qq_44936079/article/details/107921530)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文