4

when running:

import scipy
scipy.ndimage.imread('path/to/image',mode='RGB')

I got

AttributeError: module 'scipy.ndimage' has no attribute 'imread'

I already tried to uninstall and reinstall scipy and also to reinstall Pillow and numpy as said there

Is there some missing module?

Andre
  • 1,149
  • 2
  • 10
  • 18
  • 3
    imread is deprecated and removed since 1.2. Which version of scipy are you using? – Trickytree22 Aug 01 '19 at 12:35
  • Possible duplicate of [scipy.misc module has no attribute imread?](https://stackoverflow.com/questions/15345790/scipy-misc-module-has-no-attribute-imread) – Trickytree22 Aug 01 '19 at 12:42

3 Answers3

1

I came across this issue today as well. This happens because scipy.ndimage.imread is deprecated, see doc here.

To do the same, you can to use the imageio package

conda install -c conda-forge imageio

After this, you can do

import imageio
imageio.imread('path/to/image',mode='RGB')
0

A library that provides imread which most people already have is matplotlib. Just use it like this:

import matplotlib
matplotlib.pyplot.imread('path')
Agile Bean
  • 6,437
  • 1
  • 45
  • 53
0

Using pytorch below method worked for me.

import matplotlib.pyplot as plt plt.imread('Image_path')

M.Naveed Riaz
  • 55
  • 1
  • 5