`imread` is deprecated in SciPy 1.0.0, and will be removed in 1.2.0. Use ``imageio.imread`` instead.


如題干所述,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")

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM