Module 'skimage.data' has no attribute 'load'

Hi! I’m trying to use this software that uses scikit-image and I’m getting this error when I try to load the image I want to process

AttributeError: module 'skimage.data' has no attribute 'load'

The line of code it’s having a problem with is this:

img = skimage.data.load('C:/Users/GustafK/source/repos/github/kylberg/ScribbleTrace/MagrittePipe.jpg',as_gray=True)

I am using my own location for the file instead of the default above of course. Interestingly, The scikit-image.org site says 0.18.0 is the latest version, but I get this

PS C:\Users\satre> python -c "import skimage; print(skimage.__version__)"
0.18.1

I’m a newbie, so you may need to dumb down your answer if you have one. Here is the code I’m using: https://github.com/kylberg/ScribbleTrace

Hi @satre, Thanks for your post.

You need to use

from skimage import io
img = io.imread(filename)

to load the image. For more details, have a look at Getting started — skimage v0.18.0 docs.

skimage.data has some data used for examples and tutorials. Module: data — skimage v0.18.0 docs list all images bundled with scikit-image.

When I visit https://scikit-image.org/, I see

Stable (release notes)

0.18.1 - December 2020

So you are using the latest version.

I hope this is helpful.

1 Like

I tried changing the code with the above guidelines, but it didn’t work. It’s probably more complicated than a simple line or two. I will put an issue in on the github and see if the author can clarify or fix.

Thanks!