implicit_dist icon indicating copy to clipboard operation
implicit_dist copied to clipboard

segmentation fault from python bindings

Open Linusnie opened this issue 1 year ago • 3 comments

hi, first off thanks for this great work! I've been trying to run the demo notebook, but I'm running into a segmentation fault when using the python bindings:

import pyimplicitdist
p = pyimplicitdist.CameraPose()
p.t = np.array([0., 0., 0.])
# Segmentation Fault (core dumped)

I tried building inside the poselib docker container as discussed here https://github.com/PoseLib/PoseLib/issues/82 but I'm still getting segmentation fault from pyimplicitdist. Any suggestions?

Linusnie avatar Jul 03 '24 12:07 Linusnie

@vlarsson, do you have any idea why this is the case?

lpanaf avatar Oct 18 '24 14:10 lpanaf

I would try bumping the pybind11 version to the latest. We had some weird interactions earlier that came from some numpy version.

vlarsson avatar Oct 18 '24 15:10 vlarsson

I installed pybind11, downgraded numpy 2.1.3 to 1.26.4 and rebuilt implicit_dist 1.1.0. This solved it for me.

Before:

IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import pyimplicitdist
In [2]: import numpy as np
In [3]: a = pyimplicitdist.CameraPose()
In [4]: a.t = np.array([1,2,3])
Segmentation fault (core dumped)

After:

In [1]: import pyimplicitdist
In [2]: import numpy as np
In [3]: a = pyimplicitdist.CameraPose()
In [4]: a.t = np.array([1,2,3])
In [5]: a.q_vec = np.array([1,2,3,4])
In [6]: 

nattachart avatar Nov 15 '24 08:11 nattachart