problem with measure.label

1,332 views
Skip to first unread message

Julien Derr

unread,
May 4, 2015, 11:46:09 AM5/4/15
to scikit...@googlegroups.com
Hi everyone, it is me again ...
I got this error with the label function
TypeError: label() got an unexpected keyword argument 'connectivity'

but I used it exactly like written in the help :

cc= label(binary2,connectivity=2)

I thought it was maybe a problem of version, but it is written in my own help when I type ?label,
so what could it be ? ideas?

thanks again!

Julien

François Boulogne

unread,
May 4, 2015, 12:03:55 PM5/4/15
to scikit...@googlegroups.com
Hi Julien,

I can't reproduce with label(np.zeros(5), connectivity=1). Does this
line works for you? Could you provide a minimal example please?

Best,

--
François Boulogne.
http://www.sciunto.org
GPG: 32D5F22F

Ji Zhou

unread,
Jun 12, 2015, 11:25:44 AM6/12/15
to scikit...@googlegroups.com
Hi,

I have the same issue when using scikit image (Anaconda distribution, which is up-to-date) to label some image objects. Error messages are: 

from skimage.measure import label
import numpy as np
label(np.zeros(5), connectivity=1)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-df99425b8b1f> in <module>()
      2 import numpy as np
      3 
----> 4 label(np.zeros(5), connectivity=1)


TypeError: label() got an unexpected keyword argument 'connectivity'


Could you help? 

Ji

Stefan van der Walt

unread,
Jun 12, 2015, 1:20:43 PM6/12/15
to scikit...@googlegroups.com
On 2015-06-12 08:04:46, Ji Zhou <gashj...@gmail.com> wrote:
> I have the same issue when using scikit image (Anaconda
> distribution, which is up-to-date) to label some image
> objects. Error messages are:

Can you please verify your version?

import skimage
print(skimage.__version__)

Thanks
Stéfan

Josh Warner

unread,
Jun 12, 2015, 2:33:57 PM6/12/15
to scikit...@googlegroups.com, ste...@berkeley.edu

I cannot reproduce with everything installed fresh via miniconda on Win7.

>>> from skimage.measure import label
>>> import numpy as np
>>> label(np.zeros(5), connectivity=1
)
array([0, 0, 0, 0, 0], dtype=int64)

Juan Nunez-Iglesias

unread,
Jun 12, 2015, 9:28:35 PM6/12/15
to scikit...@googlegroups.com
This looks like a version problem. Connectivity was added in 0.11.

--
You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ji Zhou

unread,
Jun 13, 2015, 11:30:20 AM6/13/15
to scikit...@googlegroups.com
Dear all, 

Many thanks for the prompt response! I checked the version of scikit image, which suggests that it is 0.10.1. 

However, after I used conda install scikit-image=0.11.3

I still cannot update the version of iPython notebook. Could you please give me a hand? 

Cheers,
Ji

Stefan van der Walt

unread,
Jun 13, 2015, 11:33:42 AM6/13/15
to scikit...@googlegroups.com
On 2015-06-13 06:50:03, Ji Zhou <gashj...@gmail.com> wrote:
> I still cannot update the version of iPython notebook. Could you
> please give me a hand?

What do you mean by this? Do you mean that you cannot access the
latest version of skimage? You'll have to restart your notebook
kernel.

Stéfan

Ji Zhou

unread,
Jun 13, 2015, 4:37:56 PM6/13/15
to scikit...@googlegroups.com

I use conda to update scikit image package on mac. However after undating and restarting the kernel, the scikit image was still 0.10.1 on mac.

Interestingly, on my Windows machine, the same procedure has successfully update scikit image.

One thing I shall point out is that I tried to uninstall anaconda on my mac and was failed.

Ji

--
You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/-YegZib4VK8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.

Josh Warner

unread,
Jun 13, 2015, 7:57:07 PM6/13/15
to scikit...@googlegroups.com, gashj...@gmail.com
This sounds like you may have conflicting Python installations. `conda` updating scikit-image successfully means you should have version 11.3 _somewhere_, but your PATH may still be preferentially finding a different Python/IPython different from the one your `conda` points to.

Investigate this with `which python` to see what the system is doing when you ask for Python.

Further instructions would probably best be obtained through the conda mailing list. 
To unsubscribe from this group and all its topics, send an email to scikit-image+unsubscribe@googlegroups.com.

Ji Zhou

unread,
Jun 17, 2015, 5:29:03 PM6/17/15
to scikit...@googlegroups.com
Dear all, thanks for the help! I eventually figure out the issue is iPython Notebook is referring to a different skimage library, which was included in the Canopy distribution... 

import os
path = os.path.dirname(skimage.__file__)

/Users/zhouj/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/skimage

So after uninstalling the Canopy distribution, it is working okay now :-) 

Cheers,
Ji

On Monday, 4 May 2015 16:46:09 UTC+1, Julien Derr wrote:
Reply all
Reply to author
Forward
0 new messages