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

Segmentation Fault for Minimization Problem #159

Open
jusevitch opened this issue Sep 20, 2024 · 0 comments
Open

Segmentation Fault for Minimization Problem #159

jusevitch opened this issue Sep 20, 2024 · 0 comments

Comments

@jusevitch
Copy link

I'm getting a segmentation fault when running the following MWE using cvxpylayers:

import jax
import jax.numpy as jnp
import cvxpy as cp
from cvxpylayers.jax import CvxpyLayer


if __name__ == "__main__":

    v1 = jnp.array([
        [1., 1.],
        [1., 3.],
        [3., 3.],
        [3., 1.]
    ])
    t = 1.0

    th_x = cp.Variable((4, 1), name="th_x")
    V_x = cp.Parameter((4, 2), name="V_x")

    problem = cp.Problem(
        cp.Minimize(cp.norm(V_x.T @ th_x)),
        [
            cp.log_sum_exp(cp.hstack((0, t*cp.sum(th_x))))/t <= 1 + cp.log(2)/t,
        ]
    )
    cvxpylayer = CvxpyLayer(
        problem,
        parameters = [V_x],
        variables=[th_x]
    )
    
    th_xstar = cvxpylayer(v1)

Output:

Segmentation fault (core dumped)

System information:

  • Ubuntu 22.04
  • cvxpy version 1.5.3
  • cvxpylayers version 0.1.6
  • JAX version 0.4.33
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

1 participant