[SciPy-user] Getting started with optimize.fmin_l_bfgs_b

Christian Kristukat ckkart at hoc.net
Wed Jun 29 04:54:13 CDT 2005


Nils Wagner wrote:
> Traceback (most recent call last):
>  File "bfgs_b.py", line 8, in ?
>    best, val, d = optimize.fmin_l_bfgs_b(func, guess, bounds=bounds)
>  File "/usr/local/lib/python2.4/site-packages/scipy/optimize/lbfgsb.py", 
> line 183, in fmin_l_bfgs_b
>    f[0], g = func_and_grad(x)
>  File "/usr/local/lib/python2.4/site-packages/scipy/optimize/lbfgsb.py", 
> line 135, in func_and_grad
>    f, g = func(x, *args)
> TypeError: unpack non-sequence
> 
> How can I resolve the problem ?

Look at the docstring of l_bfgs_b - func is expected to return the function and 
its gradient!

Regards, Christian



More information about the SciPy-user mailing list