Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot reproduce https://docs.sciml.ai/Surrogates/stable/tutorials/#Example-of-NeuralSurrogate #505

Open
gaelforget opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@gaelforget
Copy link

gaelforget commented Jan 8, 2025

Describe the bug 🐞

Cannot reproduce https://docs.sciml.ai/Surrogates/stable/tutorials/#Example-of-NeuralSurrogate

because packages fail to install the needed packages together.

Expected behavior

that the needed packages get installled

Minimal Reproducible Example 👇

Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.

In a temporary environment :

julia> using Flux, Surrogates, Statistics, SurrogatesFlux
 │ Packages [Flux, Surrogates, SurrogatesFlux] not found, but packages named [Flux, Surrogates,
 │ SurrogatesFlux] are available from a registry.
 │ Install packages?
 │   (jl_3fVXe0) pkg> add Flux Surrogates SurrogatesFlux
 └ (y/n/o) [y]: y
   Resolving package versions...

After 27ae667 I can execute using Flux, Surrogates, Statistics, SurrogatesFlux

but now I get the error below upon calling NeuralSurrogate.

Error & Stacktrace ⚠️

julia> sgt = NeuralSurrogate(x_train, y_train, bounds..., model=model, loss=loss, opt=optimizer, n_echos=n_epochs)
┌ Warning: `Flux.params(m...)` is deprecated. Use `Flux.trainable(model)` for parameter collection,
│ and the explicit `gradient(m -> loss(m, x, y), model)` for gradient computation.
└ @ Flux ~/.julia/packages/Flux/Mhg1r/src/deprecations.jl:93
ERROR: can't mix implict Params with explict rule from Optimisers.jl
To use `Flux.params(m)` in `train!`, the 4th argument must be from the old `Flux.Optimise` sub-module.
But better to use the new explicit style, in which `m` itself is the 2nd argument.

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
Status `/private/var/folders/vn/3r695jqd3177cw09wdmf3z940000gn/T/jl_3fVXe0/Project.toml` (empty project)
  • Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Status `/private/var/folders/vn/3r695jqd3177cw09wdmf3z940000gn/T/jl_3fVXe0/Manifest.toml` (empty manifest)
  • Output of versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M3
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m3)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

Additional context

Add any other context about the problem here.

@gaelforget gaelforget added the bug Something isn't working label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant