pythonscikit-imageimread

module 'skimage.data' has no attribute 'imread'


import skimage 
image = skimage.data.imread("my_image.png")

I used this code to read an image, but I got an error as "skimage.data" has no attribute "imread". My skimage version is 0.18.1. What has to be changed in this to read an image?


Solution

  • The error is straightforward. You try to call the imread function in the data module, but there is no such function in this module. Call

    skimage.io.imread('blah.png') 
    

    instead.