'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 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 warped