Search code examples
python-3.xattributeerrorcplexcvxpy

CVXPY and CPLEX - What is this attribute error about?


I am trying to solve the Unit Commitment Problem (Mixed Integer Quadratic Programming problem) using the CVXPY framework for modelling the problem and CPLEX for solving the problem.

When I run my code I get an AttributeError: 'Problem' object has no attribute '_compute_once_is_mixed_integer'

And this is the error I mainly get:

AttributeError: 'Problem' object has no attribute '_compute_once_is_mixed_integer'


Solution

  • This doesn't appear to be a CPLEX-specific problem. A similar cvxpy issue was reported in github here. In short:

    The stack trace makes it seem like the issue is with your code, not CVXPY. In particular, it indicates that one of your constraints in constrlist is a NumPy object.

    If you comment out the following constraint:

    # Spinning Reserve Constraint
    sum(isOn[:, k] * P_MAX) >= Load[k] + SR[k]
    

    Then, the solve is successful.