I'm trying to solve optimization problems using cvxpy and MOSEK. Despite the fact that both packages seem to work independently, I don't manage to get them function together. Whenever I ask cvxpy to solve any problem with MOSEK, I always get the error:
AttributeError: type object 'solsta' has no attribute 'near_optimal'
What am I doing wrong?
Consider the following (minimal) code:
import cvxpy as cp
x = cp.Variable(2)
obj = cp.Minimize(x[0] + x[1])
constraints = [x >= 2]+[x<=5]
prob = cp.Problem(obj, constraints)
# Solve with MOSEK.
prob.solve(solver=cp.MOSEK,verbose=True)
print("optimal value with MOSEK:", prob.value)
As with any other optimization I've tried with MOSEK and cvxpy, the compiler crashes on this line:
prob.solve(solver=cp.MOSEK,verbose=True)
MOSEK correctly solves the problem, but there seems to be an issue in communicating the solution to cvxpy.