Reputation: 1367
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
Reputation: 81
Using pytorch below method worked for me.
import matplotlib.pyplot as plt plt.imread('Image_path')
Upvotes: 0
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
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