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

UndefVarError: AutoZygote not defined #158

Closed
rozsasarpi opened this issue Aug 31, 2021 · 6 comments
Closed

UndefVarError: AutoZygote not defined #158

rozsasarpi opened this issue Aug 31, 2021 · 6 comments

Comments

@rozsasarpi
Copy link

When running this:

using GalacticOptim: AutoZygote

I get the following error:

ERROR: UndefVarError: AutoZygote not defined
Stacktrace:
  [1] eval
    @ .\boot.jl:360 [inlined]
  [2] eval
    @ .\Base.jl:39 [inlined]
  [3] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer c:\Users\arpada\.vscode\extensions\julialang.language-julia-1.3.33\scripts\packages\VSCodeServer\src\repl.jl:157
  [4] (::VSCodeServer.var"#69#71"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\arpada\.vscode\extensions\julialang.language-julia-1.3.33\scripts\packages\VSCodeServer\src\repl.jl:123
  [5] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:491
  [6] with_logger
    @ .\logging.jl:603 [inlined]
  [7] (::VSCodeServer.var"#68#70"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\arpada\.vscode\extensions\julialang.language-julia-1.3.33\scripts\packages\VSCodeServer\src\repl.jl:124
  [8] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
  [9] invokelatest(::Any)
    @ Base .\essentials.jl:706
 [10] macro expansion
    @ c:\Users\arpada\.vscode\extensions\julialang.language-julia-1.3.33\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [11] (::VSCodeServer.var"#53#54")()
    @ VSCodeServer .\task.jl:411

Setup:

  • Julia v1.6.2
  • GalacticOptim v2.0.3
  • Win 10 v1909

Additional info:

  • Because a few months ago the same code was working without an error, I tried it with GalacticOptim v1.3.0 but got the same error.
  • Tried it also in a new environment with only GalactiOptim (and its dependencies) but got the same error.
  • using GalacticOptim: OptimizationFunction, OptimizationProblem, solve works without an issue.

Any hunch on what might be the problem?

@Vaibhavdixit02
Copy link
Member

Vaibhavdixit02 commented Aug 31, 2021

Do using Zygote before the above line and it should work fine, this happened because all AD backends have been moved behind @requires since v2 bump

@rozsasarpi
Copy link
Author

Thanks a lot for the prompt reply and for the explanation! Having using Zygote before using GalacticOptim solved the issue.

@erlebach
Copy link

The documentation does mention that Zygote.jl is necessary, but does not mention that it is the user's responsibility to include in their package. Shouldn't that be explicitly added? Thanks.

@ChrisRackauckas
Copy link
Member

It should be explicitly added to the docs. We should probably make a tutorial that's specifically about AD handling. @Vaibhavdixit02 let's chat about that.

@Vaibhavdixit02
Copy link
Member

Sure, I am planning a blog post as well after DiffEqParamEstim changes land. But that might not be related, let's make it more explicit in the docs.

@ChrisRackauckas
Copy link
Member

See SciML/SciMLDocs#108 tutorials vs examples. Optimization.jl needs a getting started tutorial to be fleshed out, and some of the current stuff needs to be moved to examples. And there needs to be a lot more docs on the minibatching stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants