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

IndexError in saliency.py for rbd #3

Open
dineshbvadhia opened this issue Jun 6, 2017 · 11 comments
Open

IndexError in saliency.py for rbd #3

dineshbvadhia opened this issue Jun 6, 2017 · 11 comments

Comments

@dineshbvadhia
Copy link

Running demo.py, get 'rbd' error in saliency.py:

File "saliency.py", line 62, in
edges = [[vertices[x%num_vertices],
vertices[x/num_vertices]] for x in edges]
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

Both ft and mdb run without problems.

@RoseLii
Copy link

RoseLii commented Nov 8, 2017

please help me
ImportError: No module named pyimgsaliency

@qiaoshh
Copy link

qiaoshh commented Mar 29, 2018

,I have the same problem, maybe u can run the code with the mainly funciotn by building a new programme.

@zzApotheosis
Copy link

Did any of you guys ever find out what was wrong? I've got the same problem @dineshbvadhia has.

@shaoqia
Copy link

shaoqia commented May 12, 2018

the same problem @dineshbvadhia

@Eracro
Copy link

Eracro commented May 18, 2018

Hola !

I think it's just a little type problem due to the division, you can correct it by casting the result before using it as an index, just replace the line 61 in saliency.py by :

edges = [[vertices[x%num_vertices],vertices[int(x/num_vertices)]] for x in edges]

and it should be ok

@doublemanyu
Copy link

Running demo.py, get 'rbd' error in saliency.py:

File "saliency.py", line 62, in
edges = [[vertices[x%num_vertices],
vertices[x/num_vertices]] for x in edges]
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

Both ft and mdb run without problems.

Have you sloved it yet?
I meet the same probloem. Could you tell me how can i fix it?

@roysubhankar
Copy link

Running demo.py, get 'rbd' error in saliency.py:

File "saliency.py", line 62, in
edges = [[vertices[x%num_vertices],
vertices[x/num_vertices]] for x in edges]
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

Both ft and mdb run without problems.

The error occurs because this code is written in Python2.7. If you run in python2.7 environment there is no error and it works fine.

@suzhengpeng
Copy link

i got the same error.. can anyone tell me how to fix it??

@Yqknight
Copy link

Yqknight commented Jan 7, 2020

Hola !

I think it's just a little type problem due to the division, you can correct it by casting the result before using it as an index, just replace the line 61 in saliency.py by :

edges = [[vertices[x%num_vertices],vertices[int(x/num_vertices)]] for x in edges]

and it should be ok

It did work! Thank you very much

@Liangliangb
Copy link

After I modified it, a new error appeared: geodesic[v1,v2] = path_length(all_shortest_paths_color[v1][v2],G)

IndexError: index 247 is out of bounds for axis 1 with size 247

@Liangliangb
Copy link

After I modified it, a new error appeared: geodesic[v1,v2] = path_length(all_shortest_paths_color[v1][v2],G)
IndexError: index 247 is out of bounds for axis 1 with size 247

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