yhenon/pyimgsaliency

IndexError in saliency.py for rbd

Opened this issue ยท 11 comments

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.

please help me
ImportError: No module named pyimgsaliency

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

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

the same problem @dineshbvadhia

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

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?

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.

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

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

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

ๅž‹

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