Python 运行Scipy.ndimages.imread时的AttributeError
运行时:Python 运行Scipy.ndimages.imread时的AttributeError,python,scipy,pip,python-module,Python,Scipy,Pip,Python Module,运行时: 导入scipy scipy.ndimage.imread('path/to/image',mode='RGB')) 我得到 AttributeError: module 'scipy.ndimage' has no attribute 'imread' 我已经尝试卸载和重新安装scipy,也尝试重新安装Pillow和numpy,如前所述 是否缺少一些模块?我今天也遇到了这个问题。这是因为scipy.ndimage.imread已被弃用,请参阅文档 要执行相同的操作,可以使用imag
导入scipy
scipy.ndimage.imread('path/to/image',mode='RGB'))
我得到
AttributeError: module 'scipy.ndimage' has no attribute 'imread'
我已经尝试卸载和重新安装scipy,也尝试重新安装Pillow和numpy,如前所述
是否缺少一些模块?我今天也遇到了这个问题。这是因为scipy.ndimage.imread已被弃用,请参阅文档 要执行相同的操作,可以使用imageio包
conda install -c conda-forge imageio
在这之后,你可以
import imageio
imageio.imread('path/to/image',mode='RGB')
提供大多数人已有的
imread
的库是matplotlib
。就像这样使用它:
import matplotlib
matplotlib.pyplot.imread('path')
imread已从1.2版起被弃用和删除。您使用的是哪个版本的scipy?MatPlotlib的可能副本正在将图像转换为
浮点值
!