TrishGillett / pysdpt3glue

Glue code for solving semidefinite programs in Cvxpy format using the SDPT3 package for Matlab.
MIT License
13 stars 3 forks source link

AssertionError: Stopping, the message is not properly formed #38

Closed vsiddhu closed 6 years ago

vsiddhu commented 7 years ago

Thank for writing this glue package, have been looking for something like that. I got the error message indicated in the subject line on the example code from the README file here using the Matlab installed option. Here is the code I ran.

import os 
from cvxpy import *
import sdpt3glue as slv

X = Semidef(3)
obj = Minimize(X[0, 2])
constraints = [-0.2 <= X[0, 1], X[0, 1] <= -0.1, 0.4 <= X[1, 2], X[1, 2] <= 0.5]
constraints += [X[i, i] == 1 for i in range(3)]

problem = Problem(obj, constraints)

cwd = os.getcwd()
matfile_target = os.path.join(cwd, 'matfile.mat')  # Where to save the .mat file to
output_target = os.path.join(cwd, 'output.txt')    # Where to save the output log

result = slv.sdpt3_solve_problem(problem, slv.MATLAB, matfile_target,
                                       output_target=output_target)

But I got the assertion error, which seems to be stemming from 'sdpt3glue/result.pyc' function make_result_dict(msg)'. Not sure how to make the example code work.

ipa-lth commented 6 years ago

Hi, I stumbled across the same issue. I guess Trish finished her PhD and is not so much involved into this project anymore..

Anyway, I figured that something was wrong in the path within the Octave call. The working directory was not correct and octave was not finding the produced .m script to run. I fixed it in my fork. Works for me. I don't know if it works on other systems. The same issue remains with the docker version, but probably a comparable patch would do the job.

https://github.com/ipa-lth/pysdpt3glue

Obviously you need to install it from source then. Good luck.