如题干所述,scipy 里面的 imread 读取图片会出错,代码如下:

from scipy import misc

misc.imread("picture/scipy子模块.png")

报错信息为:

D:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:3: DeprecationWarning: `imread` is deprecated!
`imread` is deprecated in SciPy 1.0.0, and will be removed in 1.2.0.
Use ``imageio.imread`` instead.
  This is separate from the ipykernel package so we can avoid doing imports until

解决方法:

阅读以上报错信息,发现需要调用 imageio.imread ,而 scipy 中没有 scipy.imageio 子模块。

查阅相关信息,了解到,imageio 是一个独立的模块。

代码修改如下:

import imageio

imageio.imread("picture/scipy子模块.png")

 

相关文章:

  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-05-15
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-08-25
  • 2021-07-16
  • 2021-06-10
  • 2021-10-07
  • 2021-10-10
相关资源
相似解决方案