Andre
Andre

Reputation: 1367

AttributeError while running Scipy.ndimages.imread

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?

Upvotes: 4

Views: 4914

Answers (3)

M.Naveed Riaz
M.Naveed Riaz

Reputation: 81

Using pytorch below method worked for me.

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

Upvotes: 0

Agile Bean
Agile Bean

Reputation: 7151

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

import matplotlib
matplotlib.pyplot.imread('path')

Upvotes: 0

Schwinn Zhang
Schwinn Zhang

Reputation: 71

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')

Upvotes: 1

Related Questions