could anyone check nlp_3.py from updated scikits.openopt?
Hi all, Nils Wagner informs me of a bug that I don't observe, so I can't fix the one. Could anyone update openopt from svn and run (after "sudo python setup.py install") examples/nlp_3.py ? (It works well for me) Thank you in advance, D.
dmitrey <dmitrey.kroshko <at> scipy.org> writes:
Could anyone update openopt from svn and run (after "sudo python setup.py install") examples/nlp_3.py ?
I updated openopt from svn to rev. 896 and installed it with python setup.py install. Running the nlp_3.py script raises an exception suggesting that the solver ralg may not be installed. I'm not sure if I needed to do anything else with the install although I don't believe I had to previously. HTH, Dave Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] IPython 0.8.2.svn.r2848 -- An enhanced Interactive Python. In [1]: run -i nlp_3.py OO Error:incorrect solver is called, maybe the solver "ralg" is not installed --------------------------------------------------------------------------- OpenOptException Traceback (most recent call last) C:\src\openopt\scikits\openopt\examples\nlp_3.py in <module>() 36 p.connectIterFcn('df') 37 ---> 38 r = p.solve(solver) 39 results[solver] = (r.ff, p.getMaxResidual(r.xf), r.elapsed['solver_t ime'], r.elapsed['solver_cputime'], r.evals['f'], r.evals['c'], r.evals['h']) 40 subplot(2,1,1) c:\python25\lib\site-packages\scikits\openopt\Kernel\BaseProblem.py in solve(sel f, solvers, *args, **kwargs) 229 230 def solve(self, solvers, *args, **kwargs): --> 231 return runProbSolver(self, solvers, *args, **kwargs) 232 233 def auxFunc(self, x, *args, **kwargs): c:\python25\lib\site-packages\scikits\openopt\Kernel\runProbSolver.py in runProb Solver(p_, solver_str, *args, **kwargs) 23 solverClass = getattr(__import__(solver_str), solver_str) 24 except: ---> 25 p.err('incorrect solver is called, maybe the solver "' + solver_ str +'" is not installed') 26 27 p.solver = solverClass() c:\python25\lib\site-packages\scikits\openopt\Kernel\oologfcn.py in ooerr(msg) 14 def ooerr(msg): 15 print 'OO Error:' + msg ---> 16 raise OpenOptException(msg) 17 18 def ooPWarn(msg): OpenOptException: incorrect solver is called, maybe the solver "ralg" is not ins talled WARNING: Failure executing file: <nlp_3.py> In [2]: import numpy; numpy.__version__ Out[2]: '1.0.3.1' In [3]: import scipy; scipy.__version__ Out[3]: '0.7.0.dev3498' In [4]: from scikits import openopt; openopt.__version__ Out[4]: '0.15'
Dave, could you update openopt from svn, run [sudo] python setup.py install and run nlp_3.py once again? (I made some changes so the bug will be described more precisely) Also, what's your Python version? Regards, D. Dave wrote:
dmitrey <dmitrey.kroshko <at> scipy.org> writes:
Could anyone update openopt from svn and run (after "sudo python setup.py install") examples/nlp_3.py ?
I updated openopt from svn to rev. 896 and installed it with python setup.py install.
Running the nlp_3.py script raises an exception suggesting that the solver ralg may not be installed. I'm not sure if I needed to do anything else with the install although I don't believe I had to previously.
HTH, Dave
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] IPython 0.8.2.svn.r2848 -- An enhanced Interactive Python.
In [1]: run -i nlp_3.py OO Error:incorrect solver is called, maybe the solver "ralg" is not installed --------------------------------------------------------------------------- OpenOptException Traceback (most recent call last)
C:\src\openopt\scikits\openopt\examples\nlp_3.py in <module>() 36 p.connectIterFcn('df') 37 ---> 38 r = p.solve(solver) 39 results[solver] = (r.ff, p.getMaxResidual(r.xf), r.elapsed['solver_t ime'], r.elapsed['solver_cputime'], r.evals['f'], r.evals['c'], r.evals['h']) 40 subplot(2,1,1)
c:\python25\lib\site-packages\scikits\openopt\Kernel\BaseProblem.py in solve(sel f, solvers, *args, **kwargs) 229 230 def solve(self, solvers, *args, **kwargs): --> 231 return runProbSolver(self, solvers, *args, **kwargs) 232 233 def auxFunc(self, x, *args, **kwargs):
c:\python25\lib\site-packages\scikits\openopt\Kernel\runProbSolver.py in runProb Solver(p_, solver_str, *args, **kwargs) 23 solverClass = getattr(__import__(solver_str), solver_str) 24 except: ---> 25 p.err('incorrect solver is called, maybe the solver "' + solver_ str +'" is not installed') 26 27 p.solver = solverClass()
c:\python25\lib\site-packages\scikits\openopt\Kernel\oologfcn.py in ooerr(msg) 14 def ooerr(msg): 15 print 'OO Error:' + msg ---> 16 raise OpenOptException(msg) 17 18 def ooPWarn(msg):
OpenOptException: incorrect solver is called, maybe the solver "ralg" is not ins talled WARNING: Failure executing file: <nlp_3.py>
In [2]: import numpy; numpy.__version__ Out[2]: '1.0.3.1'
In [3]: import scipy; scipy.__version__ Out[3]: '0.7.0.dev3498'
In [4]: from scikits import openopt; openopt.__version__ Out[4]: '0.15'
_______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
dmitrey <dmitrey.kroshko <at> scipy.org> writes:
Dave, could you update openopt from svn, run [sudo] python setup.py install and run nlp_3.py once again? (I made some changes so the bug will be described more precisely) Also, what's your Python version? Regards, D.
System Info:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] IPython 0.8.2.svn.r2848 -- An enhanced Interactive Python. In [2]: import numpy; numpy.__version__ Out[2]: '1.0.3.1'
In [3]: import scipy; scipy.__version__ Out[3]: '0.7.0.dev3498'
In [4]: from scikits import openopt; openopt.__version__ Out[4]: '0.15' (rev. 897)
In [4]: run -i nlp_3.py --------------------------------------------------------------------------- ImportError Traceback (most recent call last) C:\src\openopt\scikits\openopt\examples\nlp_3.py in <module>() 37 p.debug = 1 38 ---> 39 r = p.solve(solver) 40 results[solver] = (r.ff, p.getMaxResidual(r.xf), r.elapsed['solver_t ime'], r.elapsed['solver_cputime'], r.evals['f'], r.evals['c'], r.evals['h']) 41 subplot(2,1,1) c:\python25\lib\site-packages\scikits\openopt\Kernel\BaseProblem.py in solve(sel f, solvers, *args, **kwargs) 229 230 def solve(self, solvers, *args, **kwargs): --> 231 return runProbSolver(self, solvers, *args, **kwargs) 232 233 def auxFunc(self, x, *args, **kwargs): c:\python25\lib\site-packages\scikits\openopt\Kernel\runProbSolver.py in runProb Solver(p_, solver_str, *args, **kwargs) 20 21 if p.debug: ---> 22 solverClass = getattr(__import__(solver_str), solver_str) 23 else: 24 try: c:\python25\lib\site-packages\scikits\openopt\solvers\UkrOpt\ralg.py in <module> () ----> 1 2 3 from numpy import diag, ones, inf, any, copy, zeros, dot, where, all, ti le, sum, nan, isfinite, float128, float64 4 from numpy.linalg import norm 5 from BaseAlg import * 6 from setDefaultIterFuncs import SMALL_DELTA_X, SMALL_DELTA_F, SMALL_DF , IS_LINE_SEARCH_FAILED 7 from UkrOptMisc import getConstrDirection ImportError: cannot import name float128 WARNING: Failure executing file: <nlp_3.py> Also, the only floats available in my numpy version are: In [7]: numpy.float numpy.float numpy.float64 numpy.float_ numpy.float32 numpy.float96 numpy.floating HTH, Dave
Dave, could you repeat (svn update -> nlp_3) once again? I think I have fixed the issue. Regards, D. Dave wrote:
ImportError: cannot import name float128 WARNING: Failure executing file: <nlp_3.py>
Also, the only floats available in my numpy version are:
In [7]: numpy.float numpy.float numpy.float64 numpy.float_ numpy.float32 numpy.float96 numpy.floating
HTH, Dave
dmitrey <dmitrey.kroshko <at> scipy.org> writes:
Dave, could you repeat (svn update -> nlp_3) once again? I think I have fixed the issue. Regards, D.
That seem to have fixed the initial problem. It now complains about not finding solver cvxopt_qp but I think that's expected as I haven't installed cvxopt. -Dave In [2]: run -i nlp_3.py starting solver ralg (license: BSD) with problem unnamed itn 0 : Fk= 111.281224049 MaxResidual: 1.33e+002 itn 86 Fk: 30.7036061227 MaxResidual: 9.98e-007(+) ls: 2 ralg has finished solving the problem unnamed istop: 4 (|| F[k] - F[k-1] || < ftol) Solver: Time Elapsed = 0.28 CPU Time Elapsed = 0.287123922174 Plotting: Time Elapsed = 3.64 CPU Time Elapsed = 3.62924114657 objFunValue: 30.7036061227 (feasible, max constraint = 9.98099e-007) starting solver scipy_cobyla (license: BSD) with problem unnamed scipy_cobyla has finished solving the problem unnamed istop: 1000 Solver: Time Elapsed = 0.36 CPU Time Elapsed = 0.352573581279 Plotting: Time Elapsed = 2.23 CPU Time Elapsed = 2.23213229614 objFunValue: 31.0165763677 (feasible, max constraint = 1.42109e-013) starting solver lincher (license: BSD) with problem unnamed itn 0: Fk= 111.281224049 maxResidual= 133.401636596 OO Error:incorrect solver is called, maybe the solver "cvxopt_qp" is not install ed. Maybe setting p.debug=1 could specify the matter more precisely --------------------------------------------------------------------------- OpenOptException Traceback (most recent call last) C:\src\openopt\scikits\openopt\examples\nlp_3.py in <module>() 37 p.debug = 1 38 ---> 39 r = p.solve(solver) 40 results[solver] = (r.ff, p.getMaxResidual(r.xf), r.elapsed['solver_t ime'], r.elapsed['solver_cputime'], r.evals['f'], r.evals['c'], r.evals['h']) 41 subplot(2,1,1) c:\python25\lib\site-packages\scikits\openopt\Kernel\BaseProblem.py in solve(sel f, solvers, *args, **kwargs) 229 230 def solve(self, solvers, *args, **kwargs): --> 231 return runProbSolver(self, solvers, *args, **kwargs) 232 233 def auxFunc(self, x, *args, **kwargs): c:\python25\lib\site-packages\scikits\openopt\Kernel\runProbSolver.py in runProb Solver(p_, solver_str, *args, **kwargs) 155 if p.iprint >= 0: print 'starting solver', p.solverName, '(license : ' + p.solverLicense + ')', ' with problem ', p.name 156 try: --> 157 solver(p) 158 except isSolved: 159 p.xf = p.xk c:\python25\lib\site-packages\scikits\openopt\solvers\UkrOpt\lincher.py in __sol ver__(self, p) 180 qp = QP(H=H,f=df, A=A, Aeq=Aeq, b=b, beq=beq, lb=lb, ub = ub) 181 qp.iprint = -1 --> 182 r2 = qp.solve('cvxopt_qp') # TODO: replace solver by autoselect 183 #r2 = qp.solve('qld') # TODO: replace solver by auto select 184 if r2.istop <= 0: c:\python25\lib\site-packages\scikits\openopt\Kernel\BaseProblem.py in solve(sel f, solvers, *args, **kwargs) 229 230 def solve(self, solvers, *args, **kwargs): --> 231 return runProbSolver(self, solvers, *args, **kwargs) 232 233 def auxFunc(self, x, *args, **kwargs): c:\python25\lib\site-packages\scikits\openopt\Kernel\runProbSolver.py in runProb Solver(p_, solver_str, *args, **kwargs) 25 solverClass = getattr(__import__(solver_str), solver_str) 26 except: ---> 27 p.err('incorrect solver is called, maybe the solver "' + sol ver_str +'" is not installed. Maybe setting p.debug=1 could specify the matter m ore precisely') 28 29 p.solver = solverClass() c:\python25\lib\site-packages\scikits\openopt\Kernel\oologfcn.py in ooerr(msg) 14 def ooerr(msg): 15 print 'OO Error:' + msg ---> 16 raise OpenOptException(msg) 17 18 def ooPWarn(msg): OpenOptException: incorrect solver is called, maybe the solver "cvxopt_qp" is no t installed. Maybe setting p.debug=1 could specify the matter more precisely WARNING: Failure executing file: <nlp_3.py> In [3]:
participants (2)
-
Dave
-
dmitrey