运行时:
import scipy
scipy.ndimage.imread('path/to/image',mode='RGB')
我得到
AttributeError: module 'scipy.ndimage' has no attribute 'imread'
我已经尝试卸载并重新安装 scipy,并重新安装 Pillow 和 numpy,如所述 there
是否缺少某些模块?
最佳答案
我今天也遇到这个问题了。发生这种情况是因为 scipy.ndimage.imread 已被弃用,请参阅文档 here .
要做同样的事情,你可以使用 imageio 包
conda install -c conda-forge imageio
在此之后,您可以执行以下操作
import imageio
imageio.imread('path/to/image',mode='RGB')
关于python - 运行 Scipy.ndimages.imread 时出现属性错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57309130/