8000 Issue in running OptimizationFunction · Issue #686 · SciML/Optimization.jl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
8000 Skip to content
Issue in running OptimizationFunction #686
Closed
@lakshaya17

Description

@lakshaya17

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0