davidhallac / TVGL

53 stars 24 forks source link

Name 'semidefinite' is not defined #4

Closed gaspa93 closed 6 years ago

gaspa93 commented 6 years ago

Hi, I have imported the repository after the installation of cvxpy and all its dependencies, but when I try to run the exampleTVGL.py script it gives me the error:

Traceback (most recent call last): File "exampleTVGL.py", line 17, in thetaSet = tvgl.TVGL(data, lengthOfSlice, lamb, beta, indexOfPenalty = 3, verbose=True) File "/home/brambilla/users/mattiagasparini/TVGL/TVGL.py", line 50, in TVGL S = semidefinite(size, name='S') NameError: name 'semidefinite' is not defined

I looked into all the files but I did not find the definiton of semidefinite function and also in the import there is no reference to these. Moreover, it also raises the warning "SyntaxWarning: import * only allowed at module level", so the modules defined in the other scripts are not imported: could be that the problem?

Thank you,

Mattia

davidhallac commented 6 years ago

Hi Mattia,

I think the issue might be something similar to this: https://github.com/snap-stanford/snapvx/issues/34. TVGL relies on CVXPY version 0.4, but you most likely downloaded the newest version (1.0), whereas TVGL has not yet been updated to support version the API changes in version 1.0.

Can you re-install CVXPY Version 0.4 instead? That should fix your issue and get your code working!

gaspa93 commented 6 years ago

Thank you very much, that worked out perfectly! There was no reference about what version of CVXPY to use, so I installed the latest version: it works correctly with version 0.4