Closed
Description
I am trying to run the example in the README, but I am getting the following error:
MethodError: no method matching (OptimizationFunction{true})(::typeof(rosenbrock), ::AutoForwardDiff{nothing, Nothing})
Some of the types have been truncated in the stacktrace for improved reading. To emit complete information
in the stack trace, evaluate `TruncatedStacktraces.VERBOSE[] = true` and re-run the code.
Closest candidates are:
(OptimizationFunction{iip})(::Any) where iip at C:\Users\lakshay\.julia\packages\SciMLBase\zXEYU\src\scimlfunctions.jl:3907
(OptimizationFunction{iip})(::Any, ::SciMLBase.AbstractADType; grad, hess, hv, cons, cons_j, cons_h, lag_h, hess_prototype, cons_jac_prototype, cons_hess_prototype, lag_hess_prototype, syms, paramsyms, observed, hess_colorvec, cons_jac_colorvec, cons_hess_colorvec, lag_hess_colorvec, expr, cons_expr, sys) where iip at C:\Users\lakshay\.julia\packages\SciMLBase\zXEYU\src\scimlfunctions.jl:3907
Stacktrace:
[1] OptimizationFunction(::Function, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ SciMLBase C:\Users\lakshay\.julia\packages\SciMLBase\zXEYU\src\scimlfunctions.jl:3905
[2] OptimizationFunction(::Function, ::Vararg{Any})
@ SciMLBase C:\Users\lakshay\.julia\packages\SciMLBase\zXEYU\src\scimlfunctions.jl:3905
[3] top-level scope
@ In[15]:2
Particularly I am running this code:
using ForwardDiff
f = OptimizationFunction(rosenbrock, Optimization.AutoForwardDiff())
prob = OptimizationProblem(f, x0, p)
sol = solve(prob, BFGS())
I would be obliged if someone could help me with the same.
Regards