FluxML / Flux.jl

Relax! Flux is the ML library that doesn't make you tensor
https://fluxml.ai/
Other
4.48k stars 604 forks source link

Missing Tracker dependency causes DiffEqFlux v0.4.0 and DifferentialEquations v6.6.0 fail to pre-compile in (J V1.3) #975

Closed cems2 closed 4 years ago

cems2 commented 4 years ago

Moved this issue as new issue found in #974

Problem DiffEqFlux and DifferentialEquations give errors during Pre-compile in (Julia V1.3) due to errors related to Tracker not found

platform Julia v1.3 install on mac os. using Pkg.add to install . Status ~/.julia/environments/v1.3/Project.toml [aae7a2af] DiffEqFlux v0.4.0 [0c46a032] DifferentialEquations v6.6.0 [587475ba] Flux v0.10.0 [7073ff75] IJulia v1.20.2 [91a5bcdd] Plots v0.28.4 [9f7883ad] Tracker v0.2.6

Expected outcome In Julia 1.2, which installs an older (0.9.0) Flux package these errors do not occur and one can use the packages.

Actual Outcome

Errors thrown by DiffEqFlux v0.4.0 precompile Warnings thrown by DifferentialEquations v6.6.0

Regression both warnings and errors refer to Missing Tracker dependency. Addititionally some of the messages seem to say this dependency is supposed to be supplied by the Flux Package.

However the news.md says that Tracker Dependency has been removed in favor or Zygote in Flux 0.10.0 perhaps this has something to do with why it is missing.

I read an older closed issue on Tracker dependency (#695 ) that applies only to earlier revisions of Flux and the fix there was to add Tracker package. But I did this and it does not fix the problem.

I'm not sure if I could revert this to Flux 0.9.0 (I don't know how to ) but even if I did this is not as desirable since the functor macro is not available in that version.

Code to reproduce 100% reproducible Add the packages listed above to julia 1.3 then import DiffEqFlux or DifferentialEquations

Results

julia> using DifferentialEquations
┌ Warning: Error requiring Flux from ArrayInterface:
│ UndefVarError: Tracker not defined
│ Stacktrace:
│  [1] getproperty(::Module, ::Symbol) at ./Base.jl:13
│  [2] top-level scope at /Users/cems/.julia/packages/ArrayInterface/qMMsu/src/ArrayInterface.jl:32
│  [3] eval at ./boot.jl:330 [inlined]
│  [4] eval at /Users/cems/.julia/packages/ArrayInterface/qMMsu/src/ArrayInterface.jl:1 [inlined]
│  [5] (::ArrayInterface.var"#9#18")() at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:67
│  [6] err(::ArrayInterface.var"#9#18", ::Module, ::String) at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:38
│  [7] #8 at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:66 [inlined]
│  [8] withpath(::ArrayInterface.var"#8#17", ::String) at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:28
│  [9] #7 at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:65 [inlined]
│  [10] listenpkg(::ArrayInterface.var"#7#16", ::Base.PkgId) at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:13
│  [11] macro expansion at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:64 [inlined]
│  [12] __init__() at /Users/cems/.julia/packages/ArrayInterface/qMMsu/src/ArrayInterface.jl:31
│  [13] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:692
│  [14] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:776
│  [15] _tryrequire_from_serialized(::Base.PkgId, ::UInt64, ::String) at ./loading.jl:707
│  [16] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:765
│  [17] _tryrequire_from_serialized(::Base.PkgId, ::UInt64, ::String) at ./loading.jl:707
│  [18] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:765
│  [19] _require(::Base.PkgId) at ./loading.jl:1001
│  [20] require(::Base.PkgId) at ./loading.jl:922
│  [21] require(::Module, ::Symbol) at ./loading.jl:917
│  [22] eval(::Module, ::Any) at ./boot.jl:330
│  [23] eval_user_input(::Any, ::REPL.REPLBackend) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86
│  [24] macro expansion at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:118 [inlined]
│  [25] (::REPL.var"#26#27"{REPL.REPLBackend})() at ./task.jl:333
└ @ Requires ~/.julia/packages/Requires/9Jse8/src/require.jl:40
┌ Warning: Error requiring Flux from DiffEqBase:
│ UndefVarError: Tracker not defined
│ Stacktrace:
│  [1] getproperty(::Module, ::Symbol) at ./Base.jl:13
│  [2] top-level scope at /Users/cems/.julia/packages/DiffEqBase/DqkH4/src/init.jl:87
│  [3] eval at ./boot.jl:330 [inlined]
│  [4] eval at /Users/cems/.julia/packages/DiffEqBase/DqkH4/src/DiffEqBase.jl:1 [inlined]
│  [5] (::DiffEqBase.var"#410#434")() at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:67
│  [6] err(::DiffEqBase.var"#410#434", ::Module, ::String) at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:38
│  [7] #409 at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:66 [inlined]
│  [8] withpath(::DiffEqBase.var"#409#433", ::String) at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:28
│  [9] #408 at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:65 [inlined]
│  [10] listenpkg(::DiffEqBase.var"#408#432", ::Base.PkgId) at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:13
│  [11] macro expansion at /Users/cems/.julia/packages/Requires/9Jse8/src/require.jl:64 [inlined]
│  [12] __init__() at /Users/cems/.julia/packages/DiffEqBase/DqkH4/src/init.jl:85
│  [13] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:692
│  [14] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:776
│  [15] _tryrequire_from_serialized(::Base.PkgId, ::UInt64, ::String) at ./loading.jl:707
│  [16] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:765
│  [17] _require(::Base.PkgId) at ./loading.jl:1001
│  [18] require(::Base.PkgId) at ./loading.jl:922
│  [19] require(::Module, ::Symbol) at ./loading.jl:917
│  [20] eval(::Module, ::Any) at ./boot.jl:330
│  [21] eval_user_input(::Any, ::REPL.REPLBackend) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86
│  [22] macro expansion at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:118 [inlined]
│  [23] (::REPL.var"#26#27"{REPL.REPLBackend})() at ./task.jl:333
└ @ Requires ~/.julia/packages/Requires/9Jse8/src/require.jl:40

julia> using Plots

julia> using  DiffEqFlux
[ Info: Precompiling DiffEqFlux [aae7a2af-3d4f-5e19-a356-7da93b79d9d0]
ERROR: LoadError: LoadError: UndefVarError: Tracker not defined
Stacktrace:
 [1] include at ./boot.jl:328 [inlined]
 [2] include_relative(::Module, ::String) at ./loading.jl:1105
 [3] include at ./Base.jl:31 [inlined]
 [4] include(::String) at /Users/cems/.julia/packages/DiffEqSensitivity/DI6VG/src/DiffEqSensitivity.jl:3
 [5] top-level scope at /Users/cems/.julia/packages/DiffEqSensitivity/DI6VG/src/DiffEqSensitivity.jl:14
 [6] include at ./boot.jl:328 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1105
 [8] include(::Module, ::String) at ./Base.jl:31
 [9] top-level scope at none:2
 [10] eval at ./boot.jl:330 [inlined]
 [11] eval(::Expr) at ./client.jl:425
 [12] top-level scope at ./none:3
in expression starting at /Users/cems/.julia/packages/DiffEqSensitivity/DI6VG/src/adjoint_sensitivity.jl:1
in expression starting at /Users/cems/.julia/packages/DiffEqSensitivity/DI6VG/src/DiffEqSensitivity.jl:14
ERROR: LoadError: Failed to precompile DiffEqSensitivity [41bf760c-e81c-5289-8e54-58b1f1f8abe2] to /Users/cems/.julia/compiled/v1.3/DiffEqSensitivity/02xYn_ml8Hi.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1283
 [3] _require(::Base.PkgId) at ./loading.jl:1024
 [4] require(::Base.PkgId) at ./loading.jl:922
 [5] require(::Module, ::Symbol) at ./loading.jl:917
 [6] include at ./boot.jl:328 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1105
 [8] include(::Module, ::String) at ./Base.jl:31
 [9] top-level scope at none:2
 [10] eval at ./boot.jl:330 [inlined]
 [11] eval(::Expr) at ./client.jl:425
 [12] top-level scope at ./none:3
in expression starting at /Users/cems/.julia/packages/DiffEqFlux/t2FwV/src/DiffEqFlux.jl:3
ERROR: Failed to precompile DiffEqFlux [aae7a2af-3d4f-5e19-a356-7da93b79d9d0] to /Users/cems/.julia/compiled/v1.3/DiffEqFlux/BdO4p_ml8Hi.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1283
 [3] _require(::Base.PkgId) at ./loading.jl:1024
 [4] require(::Base.PkgId) at ./loading.jl:922
 [5] require(::Module, ::Symbol) at ./loading.jl:917
DhairyaLGandhi commented 4 years ago

In v0.9 you can use the treelike macro to achieve the same effect