Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with numpy>=1.12 #6

Open
grisaitis opened this issue Feb 1, 2017 · 5 comments
Open

Not compatible with numpy>=1.12 #6

grisaitis opened this issue Feb 1, 2017 · 5 comments

Comments

@grisaitis
Copy link
Contributor

Numpy 1.12 dropped support for indexing with floats: https://docs.scipy.org/doc/numpy-1.12.0/release.html#deprecationwarning-to-error

I think malis does this in seg_to_affgraph... I'll provide more details later

@hueifang
Copy link

hueifang commented Dec 19, 2017

Hi, I ran test_malis.py and got the following:

Traceback (most recent call last):
File "test_malis.py", line 36, in
cc = m.connected_components(nVert,node1,node2,idxkeep)
File "malis/malis.pyx", line 51, in malis.malis.connected_components
(seg,segSizes) = prune_and_renum(seg,sizeThreshold)
File "malis/malis.pyx", line 80, in malis.malis.prune_and_renum
renum = np.zeros(int(segId.max()+1),dtype=np.uint64)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

Numpy is 1.12.1. Do you have any idea as to how to fix it? Thanks!

@necrodancer
Copy link

I am suffering from the same problem as @hueifang for test_malis.py.
In the code as below:

renum = np.zeros(int(segId.max()+1),dtype=np.uint64)

It looks like there is no problem since segId.max()+1 is cast to integer.
But the error TypeError: 'numpy.float64' object cannot be interpreted as an integer occurs.
I think the error indicates that int() casting didn't work, or there is something wrong in higher version of Numpy.

p.s. My Numpy version is 1.14.5.

@hueifang
Copy link

hueifang commented Aug 7, 2018

@necrodancer: You can resolve this issue by building from source: ./make.sh. It appeared that the pip would install an old version that has the type error.

@necrodancer
Copy link

@hueifang
It worked after I built from `./make.sh'.
I really appreciate your comments. Thank you very much.

p.s. Should I close the issue?
Actually, this is the first time to ask sth in github.

@hueifang
Copy link

hueifang commented Aug 7, 2018

@necrodancer Glad it worked!

ps. hmm... I don't know. It's my first time, too. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants