It looks like you posted it in the wrong thread, which is why no one here saw that there was a response and thus we couldn’t help you. Let me copy it over to here:
Hello ChrisRackauckas,
Thank you very much for coming to my rescue:
This is exactly where my problems start:
cb()
Flux.train!(loss_rd, [p], data, opt, cb = cb)
whenever I run the callback function, I get the following errors:::
MethodError: no method matching init(::Vector{Float64}, ::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.AutoSpecialize, typeof(lotka_volterra), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; saveat=0.1)
Closest candidates are:
init(!Matched::OptimizationProblem, ::Any, ::Any…; kwargs…) at ~/.julia/packages/SciMLBase/wEAy7/src/solve.jl:144
init(!Matched::SciMLBase.AbstractJumpProblem, ::Any…; kwargs…) at ~/.julia/packages/DiffEqBase/g4OeQ/src/solve.jl:406
init(!Matched::SciMLBase.AbstractDEProblem, ::Any…; sensealg, u0, p, kwargs…) at ~/.julia/packages/DiffEqBase/g4OeQ/src/solve.jl:394
…
solve(::Vector{Float64}, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}}) at CommonSolve.jl:23
(::CommonSolve.var”#solve##kw")(::NamedTuple{(:saveat,), Tuple{Float64}}, ::typeof(solve), ::Vector{Float64}, ::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.AutoSpecialize, typeof(lotka_volterra), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}) at CommonSolve.jl:23
predict_rd() at Tst.jl:30
loss_rd() at Tst.jl:32
(::var"#32#33")() at Tst.jl:40
top-level scope at Tst.jl:45
eval at boot.jl:368 [inlined]
And I also use julia> v"1.8.1".
Thank you.