# Error with NeuralPDE and OptimizationFunction

**URL:** https://discourse.julialang.org/t/error-with-neuralpde-and-optimizationfunction/102164
**Category:** General Usage
**Tags:** question, optimization, neural-network
**Created:** [July 27, 2023, 4:06pm UTC](https://discourse.julialang.org/t/error-with-neuralpde-and-optimizationfunction/102164 "2023-07-27T16:06:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ethan\_Tran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethan_tran/32/49198_2.png) [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)
#### Post date: [July 27, 2023, 4:06pm UTC](https://discourse.julialang.org/t/error-with-neuralpde-and-optimizationfunction/102164/1 "2023-07-27T16:06:42Z")

</div>

I tried to solve the ODE problem with NeuralPDE on Jupyter notebook, and the code ran when I used the older version of Julia and packages (version 1.9.0 and I forgot the version of packages).  
I updated all packages yesterday, and when I ran the code again an error occurs following:

```julia
MethodError: no method matching cos(::Matrix{Float64})
You may have intended to import Base.cos

```

Which is not occur before I update packages.

I tried to use the older version and packages in Julia which has information as follows:  
Julia version 1.8.5.  
ModelingToolkit v8.50.0  
Lux v0.4.37  
NeuralPDE v5.6.1  
Optimization v3.15.2  
OptimizationOptimJL v0.1.9  
and got another error:

```julia
MethodError: no method matching (OptimizationFunction{true})(::typeof(loss_function), ::AutoZygote)

```

However, the code can run normally on another computer.

Please help me to fix it.  
Thank you all.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [September 25, 2023, 12:23pm UTC](https://discourse.julialang.org/t/error-with-neuralpde-and-optimizationfunction/102164/2 "2023-09-25T12:23:59Z")

</div>

This looks like it was just a versioning issue. Make sure you’re on latest versions matching the versions used in the docs. The Reproducibility section describes exactly the versions used to make the documentation:

[https://docs.sciml.ai/NeuralPDE/dev/#Reproducibility](https://docs.sciml.ai/NeuralPDE/dev/#Reproducibility)
