cvlab-epfl / LIFT

Code release for the ECCV 2016 paper
485 stars 168 forks source link

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

Closed libaosir2 closed 6 years ago

libaosir2 commented 6 years ago

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 6 years ago

Did you compile libSIFT properly?

libaosir2 commented 6 years ago

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

kmyi commented 6 years ago

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?

libaosir2 commented 6 years ago

@kmyid , i did nothing alterations in the code. And error occurs at the compute_detector.py recomputeOrientation method: print("Recomputing Orientations") new_kplist, = 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 6 years ago

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.

libaosir2 commented 6 years ago

ok,i willl try it . Thank you.