# Type FPFunctionalCache has no field caches error

**URL:** https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598
**Category:** Optimization (Mathematical)
**Created:** [August 16, 2019, 12:34am UTC](https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598 "2019-08-16T00:34:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Farnazmdi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/farnazmdi/32/24072_2.png) [@Farnazmdi](https://discourse.julialang.org/u/Farnazmdi)
#### Post date: [August 16, 2019, 12:34am UTC](https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598/1 "2019-08-16T00:34:49Z")

</div>

Hi,  
I am using `BlackBoxOptim` and I get this error when I run it.

```julia
Starting optimization with optimizer DiffEvoOpt{FitPopulation{Float64},RadiusLimitedSelector,BlackBoxOptim.AdaptiveDiffEvoRandBin{3},RandomBound{ContinuousRectSearchSpace}}
0.00 secs, 0 evals, 0 steps
type FPFunctionalCache has no field caches

Stacktrace:
 [1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18
 [2] fpsolve!(::DelayDiffEq.DDEIntegrator{CompositeAlgorithm{Tuple{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}},true,Array{Float64,1},Float64,Array{Float64,1},Float64,Float64,Float64,Array{Array{Float64,1},1},OrdinaryDiffEq.ODECompositeSolution{Float64,2,Array{Array{Float64,1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,1},1},1},DDEProblem{Array{Float64,1},Tuple{Float64,Float64},Array{Float64,1},Tuple{},true,Array{Float64,1},DDEFunction{true,typeof(DDEmodel),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},typeof(h),Nothing},CompositeAlgorithm{Tuple{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}},OrdinaryDiffEq.CompositeInterpolationData{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),DelayDiffEq.HistoryFunction{typeof(h),DelayDiffEq.HistoryODEIntegrator{CompositeAlgorithm{Tuple{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}},true,Array{Float64,1},Float64,Float64,Array{Array{Float64,1},1},OrdinaryDiffEq.ODECompositeSolution{Float64,2,Array{Array{Float64,1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,1},1},1},ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Array{Float64,1},DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem},CompositeAlgorithm{Tuple{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}},OrdinaryDiffEq.CompositeInterpolationData{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,1},1},Array{Float64,1},Array{Array{Array{Float64,1},1},1},OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}},OrdinaryDiffEq.Rosenbrock23Cache{Array{Float64,1},Array{Float64,1},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Rosenbrock23ConstantCache{Float64,typeof(identity),typeof(identity)},DiffEqDiffTools.TimeGradientWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Float64,1},Array{Float64,1}},DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},DefaultLinSolve,ForwardDiff.JacobianConfig{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},Float64},Float64,2,Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},Float64},Float64,2},1},Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},Float64},Float64,2},1}}},ForwardDiff.DerivativeConfig{ForwardDiff.Tag{DiffEqDiffTools.TimeGradientWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Float64,1},Array{Float64,1}},Float64},Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.TimeGradientWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Float64,1},Array{Float64,1}},Float64},Float64,1},1}}}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}}}},OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}},OrdinaryDiffEq.Rosenbrock23Cache{Array{Float64,1},Array{Float64,1},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Rosenbrock23ConstantCache{Float64,typeof(identity),typeof(identity)},DiffEqDiffTools.TimeGradientWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Float64,1},Array{Float64,1}},DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},DefaultLinSolve,ForwardDiff.JacobianConfig{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},Float64},Float64,2,Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},Float64},Float64,2},1},Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,Array{Float64,1}},Float64},Float64,2},1}}},ForwardDiff.DerivativeConfig{ForwardDiff.Tag{DiffEqDiffTools.TimeGradientWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Float64,1},Array{Float64,1}},Float64},Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.TimeGradientWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Float64,1},Array{Float64,1}},Float64},Float64,1},1}}}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,1},1},Array{Float64,1},Array{Array{Array{Float64,1},1},1},OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}},OrdinaryDiffEq.Rosenbrock23Cache{Array{Float64,1},Array{Float64,1},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Rosenbrock23ConstantCache{Float64,typeof(identity),typeof(identity)},DiffEqDiffTools.TimeGradientWrapper{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),DelayDiffEq.HistoryFunction{typeof(h),DelayDiffEq.HistoryODEIntegrator{CompositeAlgorithm{Tuple{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}},true,Array{Float64,1},Float64,Float64,Array{Array{Float64,1},1},OrdinaryDiffEq.ODECompositeSolution{Float64,2,Array{Array{Float64,1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,1},1},1},ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Array{Float64,1},DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem},CompositeAlgorithm{Tuple{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType}},AutoSwitch{Tsit5,Rosenbrock23{0,true,DefaultLinSolve,DataType},Rational{Int64},Float64}},OrdinaryDiffEq.CompositeInterpolationData{DelayDiffEq.ODEFunctionWrapper{true,typeof(DDEmodel),typeof(h),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,1},1},Array{Float64,1},Array{Array{Array{Float64,1},1},1},OrdinaryDiff

```

Does anyone have any idea what I’m doing wrong? I would really appreciate it.

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [August 16, 2019, 1:25pm UTC](https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598/2 "2019-08-16T13:25:34Z")

</div>

Please read [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) and post a minimal example that demonstrates the error. Thanks!

---

<div class="post-metadata">

### Author: ![Farnazmdi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/farnazmdi/32/24072_2.png) [@Farnazmdi](https://discourse.julialang.org/u/Farnazmdi)
#### Post date: [August 16, 2019, 4:35pm UTC](https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598/3 "2019-08-16T16:35:12Z")

</div>

You are right, sorry.

```julia
function Model()
...
end
prob = DDEProblem()
alg = MethodOfSteps(AutoTsit5(Rosenbrock23()))
obj = build_loss_objective(prob, alg,...)
bboptimize(obj)

```

Here I changed the `alg` from `AutoTsit5(Rosenbrock23())` to `Vern6()` and it worked.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [August 16, 2019, 4:58pm UTC](https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598/4 "2019-08-16T16:58:18Z")

</div>

I tried run your code but I only got as far as

```julia
julia> function Model()
       ...
       end
ERROR: syntax: invalid identifier name "..."

```

---

<div class="post-metadata">

### Author: ![Farnazmdi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/farnazmdi/32/24072_2.png) [@Farnazmdi](https://discourse.julialang.org/u/Farnazmdi)
#### Post date: [August 16, 2019, 5:03pm UTC](https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598/5 "2019-08-16T17:03:53Z")

</div>

@kristoffer.carlsson My problem was solved, I wrote just the structure of it here, I know it wouldn’t run.  
When I changed the `alg` as I said above, I didn’t get the error anymore.  
Thank you,

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [August 16, 2019, 6:42pm UTC](https://discourse.julialang.org/t/type-fpfunctionalcache-has-no-field-caches-error/27598/6 "2019-08-16T18:42:27Z")

</div>

We should be able to run a minimum working example by copy-and-pasting it into the REPL.

We’re looking for something like

```nohighlight
using Optim
function foo(x)
    return sum(x.^2)
end
optimize!(foo, [1.0])

```

instead of

```nohighlight
using Optim
function foo(x)
    ... my model goes here ...
end
optimize!(foo, [1.0])

```
