from scipy.ndimage import imread cannot import name imread
时间: 2023-11-12 19:09:13 浏览: 197
根据引用\[1\]和引用\[2\]的内容,从scipy.ndimage中导入imread函数在scipy1.2.0之后被移除了。因此,无法使用from scipy.ndimage import imread这个语句来导入imread函数。相反,可以使用imageio库来代替imread函数。首先,需要通过pip install imageio命令安装imageio库。然后,使用import imageio语句导入imageio库。最后,可以使用imageio.imread('xx.png')来读取图像。这样就可以实现与imread函数相同的功能。
#### 引用[.reference_title]
- *1* [【python】from scipy.misc import imread报错:ImportError: cannot import name imread](https://blog.csdn.net/weixin_36670529/article/details/113536270)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [成功解决from scipy.misc import imread, imresize ImportError: cannot import name ‘imread](https://blog.csdn.net/qq_41185868/article/details/117163399)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文