cvlab-epfl/LIFT

Segmentation fault (cure dumped) when python compute_detector.py......

Closed this issue · 6 comments

when i run the run.sh , and use opencv3.1.0 to get libSIFT.so , error occurs as follow:
./run.sh: line 74: 3091 Segmentation fault (core dumped) python compute_detector.py $_LIFT_TEST_CONFIG $_LIFT_TEST_IMG $_LIFT_KP_FILE_NAME $_LIFT_SAVE_PNG $_LIFT_USE_THEANO 0 $_LIFT_MODEL_DIR $_LIFT_NUM_KEYPOINT
/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "compute_orientation.py", line 107, in
test_data_in = data_module.data_obj(param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 64, in init
self.load_data(param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 82, in load_data
pathconf, param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 136, in load_data_for_set
angle = np.pi / 180.0 * kp[:, IDX_ANGLE] # store angle in radians
IndexError: too many indices for array

And i localizate the error at sift_tools.py line 77:libSIFT.recomputeOrientation(c_void_p(indata.ctypes.data).
but i have no idea about it...what should i do with this error?
thanks a lot

kmyi commented

Did you compile libSIFT properly?

@kmyid ,yeah,i use opencv 3.1.0 and get libSIFT.so

kmyi commented

That's very weird. We've never encountered this error before. One thing that's suspicious is also

angle = np.pi / 180.0 * kp[:, IDX_ANGLE] # store angle in radians
IndexError: too many indices for array

This probably means something is very wrong with the loading of keypoints. Is this with the test image, and no alterations in the code?

@kmyid , i did nothing alterations in the code. And error occurs at the compute_detector.py recomputeOrientation method:
print("Recomputing Orientations")
new_kp_list, _ = recomputeOrientation(image_gray, kp_list,
bSingleOrientation=True)

print("Saving to txt")
saveKpListToTxt(new_kp_list, None, output_file)

so the output_file of keypoints is null, and get the error:
angle = np.pi / 180.0 * kp[:, IDX_ANGLE] # store angle in radians
IndexError: too many indices for array

so would you send me your libSIFT.so to my email libaosir@gmail.com ? thanks a lot .

kmyi commented

so would you send me your libSIFT.so to my email libaosir@gmail.com ? thanks a lot .

That'd be meaningless since it would for sure segfault due to library incompatibilities :-( If you are not going to use the detector alone, what I suggest is to simply comment the recomputation part and then assign new_kp_list = kp_list. Recomputation is for using the detector as as stand-alone anyways... You just need to make sure that the orientation module runs afterwards.

ok,i willl try it . Thank you.