SciML / DiffEqFlux.jl

Pre-built implicit layer architectures with O(1) backprop, GPUs, and stiff+non-stiff DE solvers, demonstrating scientific machine learning (SciML) and physics-informed machine learning methods
https://docs.sciml.ai/DiffEqFlux/stable
MIT License
864 stars 154 forks source link

pkg issue #22

Closed RandallCobb closed 5 years ago

RandallCobb commented 5 years ago

Hi Chris, great work! Excellent package and tutorial. I am a newbie in Julia but I appreciated your new take on the neuro-ode that I had to try your code. While attempting to clone, precompile, and test the pkg, which I did with “add https://github.com/JuliaDiffEq/DiffEqFlux.jl/” & “test DiffEqFlux”, I got the following error "ERROR: LoadError: LoadError: UndefVarError: adjoint_sensitivities_u0 not defined." Not sure if I got anything wrong or if this is a real issue. Cheers!

ChrisRackauckas commented 5 years ago

I think you need to update packages. That is in the latest sensitivity analysis release. Use ]up.

RandallCobb commented 5 years ago

Thanks a lot. I tried to update but I still have issues see below.

ERROR: LoadError: LoadError: UndefVarError: adjoint_sensitivities_u0 not defined Stacktrace: [1] include at .\boot.jl:317 [inlined] [2] include_relative(::Module, ::String) at .\loading.jl:1044 [3] include at .\sysimg.jl:29 [inlined] [4] include(::String) at C:\Users\rand.juliapro\JuliaPro_v1.0.3.1\packages\DiffEqFlux\ARol5\src\D iffEqFlux.jl:1 [5] top-level scope at none:0 [6] include at .\boot.jl:317 [inlined] [7] include_relative(::Module, ::String) at .\loading.jl:1044 [8] include(::Module, ::String) at .\sysimg.jl:29 [9] top-level scope at none:2 [10] eval at .\boot.jl:319 [inlined] [11] eval(::Expr) at .\client.jl:393 [12] top-level scope at .\none:3 in expression starting at C:\Users\rand.juliapro\JuliaPro_v1.0.3.1\packages\DiffEqFlux\ARol5\src\F lux\layers.jl:2 in expression starting at C:\Users\rand.juliapro\JuliaPro_v1.0.3.1\packages\DiffEqFlux\ARol5\src\D iffEqFlux.jl:5 ERROR: LoadError: Failed to precompile DiffEqFlux [29eb61f6-93cc-5d97-9b01-2cce5884a08e] to C:\Users \rand.juliapro\JuliaPro_v1.0.3.1\compiled\v1.0\DiffEqFlux\GJanv.ji. Stacktrace: [1] error(::String) at .\error.jl:33 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1203 [3] _require(::Base.PkgId) at .\loading.jl:960 [4] require(::Base.PkgId) at .\loading.jl:858 [5] require(::Module, ::Symbol) at .\loading.jl:853 [6] include at .\boot.jl:317 [inlined] [7] include_relative(::Module, ::String) at .\loading.jl:1044 [8] include(::Module, ::String) at .\sysimg.jl:29 [9] include(::String) at .\client.jl:392 [10] top-level scope at none:0 in expression starting at C:\Users\rand.juliapro\JuliaPro_v1.0.3.1\packages\DiffEqFlux\ARol5\test\ runtests.jl:1 ERROR: Package DiffEqFlux errored during testing

ChrisRackauckas commented 5 years ago

Oh, the issue is likely JuliaPro

RandallCobb commented 5 years ago

so I guess the issue is resolved without a resolution.

RandallCobb commented 5 years ago

I take it back. Just installed and texted pkg on Julia 1.1. Still got errors.

DiffEqFlux: Error During Test at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\test\runtests.jl:3 Got exception outside of a @test LoadError: BoundsError Stacktrace: [1] getindex at .\number.jl:78 [inlined] [2] #477 at C:\Users\rand.julia\packages\DiffEqBase\cp0Wf\src\init.jl:65 [inlined] [3] mapreduce_first at .\reduce.jl:297 [inlined] [4] mapfoldl_impl at .\reduce.jl:60 [inlined] [5] #mapfoldl#187 at .\reduce.jl:72 [inlined] [6] mapfoldl at .\reduce.jl:72 [inlined] [7] #mapreduce#191 at .\reduce.jl:205 [inlined] [8] mapreduce at .\reduce.jl:205 [inlined] [9] sum at .\reduce.jl:399 [inlined] [10] ODE_DEFAULT_NORM at C:\Users\rand.julia\packages\DiffEqBase\cp0Wf\src\init.jl:65 [inlined] [11] ode_determine_initdt(::Array{Flux.Tracker.TrackedReal{Float64},1}, ::Float64, ::Float64, ::Float64, ::Flux.Tracker.TrackedReal{Float64}, ::Flux.Tracker.TrackedReal{Float64}, ::typeof(DiffEqBase.ODE_DEFAULT_NORM), ::ODEProblem{Array{Flux.Tracker.TrackedReal{Float64},1},Tuple{Float64,Float64},true,TrackedArray{…,Array{Float64,1}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::OrdinaryDiffEq.ODEIntegrator{Tsit5,true,Array{Flux.Tracker.TrackedReal{Float64},1},Float64,TrackedArray{…,Array{Float64,1}},Float64,Float64,Float64,Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},ODESolution{Flux.Tracker.TrackedReal{Float64},2,Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},1},ODEProblem{Array{Flux.Tracker.TrackedReal{Float64},1},Tuple{Float64,Float64},true,TrackedArray{…,Array{Float64,1}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem},Tsit5,OrdinaryDiffEq.InterpolationData{ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},Array{Float64,1},Array{Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},OrdinaryDiffEq.Tsit5ConstantCache{Flux.Tracker.TrackedReal{Float64},Float64}}}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},OrdinaryDiffEq.Tsit5Cache{Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},OrdinaryDiffEq.Tsit5ConstantCache{Flux.Tracker.TrackedReal{Float64},Float64}},OrdinaryDiffEq.DEOptions{Flux.Tracker.TrackedReal{Float64},Flux.Tracker.TrackedReal{Float64},Float64,Float64,typeof(DiffEqBase.ODE_DEFAULT_NORM),typeof(LinearAlgebra.opnorm),CallbackSet{Tuple{},Tuple{}},typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN),typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE),typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK),DataStructures.BinaryHeap{Float64,DataStructures.LessThan},DataStructures.BinaryHeap{Float64,DataStructures.LessThan},Nothing,Nothing,Int64,Array{Float64,1},Float64,Array{Float64,1}},Array{Flux.Tracker.TrackedReal{Float64},1},Flux.Tracker.TrackedReal{Float64}}) at C:\Users\rand.julia\packages\OrdinaryDiffEq\MjYk7\src\initdt.jl:30 [12] auto_dt_reset! at C:\Users\rand.julia\packages\OrdinaryDiffEq\MjYk7\src\integrators\integrator_interface.jl:236 [inlined] [13] handle_dt!(::OrdinaryDiffEq.ODEIntegrator{Tsit5,true,Array{Flux.Tracker.TrackedReal{Float64},1},Float64,TrackedArray{…,Array{Float64,1}},Float64,Float64,Float64,Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},ODESolution{Flux.Tracker.TrackedReal{Float64},2,Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},1},ODEProblem{Array{Flux.Tracker.TrackedReal{Float64},1},Tuple{Float64,Float64},true,TrackedArray{…,Array{Float64,1}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem},Tsit5,OrdinaryDiffEq.InterpolationData{ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},Array{Float64,1},Array{Array{Array{Flux.Tracker.TrackedReal{Float64},1},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},OrdinaryDiffEq.Tsit5ConstantCache{Flux.Tracker.TrackedReal{Float64},Float64}}}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},OrdinaryDiffEq.Tsit5Cache{Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},Array{Flux.Tracker.TrackedReal{Float64},1},OrdinaryDiffEq.Tsit5ConstantCache{Flux.Tracker.TrackedReal{Float64},Float64}},OrdinaryDiffEq.DEOptions{Flux.Tracker.TrackedReal{Float64},Flux.Tracker.TrackedReal{Float64},Float64,Float64,typeof(DiffEqBase.ODE_DEFAULT_NORM),typeof(LinearAlgebra.opnorm),CallbackSet{Tuple{},Tuple{}},typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN),typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE),typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK),DataStructures.BinaryHeap{Float64,DataStructures.LessThan},DataStructures.BinaryHeap{Float64,DataStructures.LessThan},Nothing,Nothing,Int64,Array{Float64,1},Float64,Array{Float64,1}},Array{Flux.Tracker.TrackedReal{Float64},1},Flux.Tracker.TrackedReal{Float64}}) at C:\Users\rand.julia\packages\OrdinaryDiffEq\MjYk7\src\solve.jl:364 [14] #init#303(::Float64, ::Array{Float64,1}, ::Array{Float64,1}, ::Nothing, ::Bool, ::Nothing, ::Bool, ::Bool, ::Bool, ::Nothing, ::Bool, ::Bool, ::Float64, ::Bool, ::Rational{Int64}, ::Nothing, ::Nothing, ::Int64, ::Rational{Int64}, ::Int64, ::Int64, ::Rational{Int64}, ::Bool, ::Int64, ::Nothing, ::Nothing, ::Int64, ::Float64, ::Float64, ::typeof(DiffEqBase.ODE_DEFAULT_NORM), ::typeof(LinearAlgebra.opnorm), ::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), ::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Int64, ::String, ::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), ::Nothing, ::Bool, ::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(DiffEqBase.init), ::ODEProblem{Array{Flux.Tracker.TrackedReal{Float64},1},Tuple{Float64,Float64},true,TrackedArray{…,Array{Float64,1}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at C:\Users\rand.julia\packages\OrdinaryDiffEq\MjYk7\src\solve.jl:327 [15] (::getfield(DiffEqBase, Symbol("#kw##init")))(::NamedTuple{(:saveat,),Tuple{Float64}}, ::typeof(DiffEqBase.init), ::ODEProblem{Array{Flux.Tracker.TrackedReal{Float64},1},Tuple{Float64,Float64},true,TrackedArray{…,Array{Float64,1}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at .\none:0 [16] #__solve#302(::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol},NamedTuple{(:saveat,),Tuple{Float64}}}, ::Function, ::ODEProblem{Array{Flux.Tracker.TrackedReal{Float64},1},Tuple{Float64,Float64},true,TrackedArray{…,Array{Float64,1}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at C:\Users\rand.julia\packages\OrdinaryDiffEq\MjYk7\src\solve.jl:6 [17] #solve#427(::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol},NamedTuple{(:saveat,),Tuple{Float64}}}, ::Function, ::ODEProblem{Array{Flux.Tracker.TrackedReal{Float64},1},Tuple{Float64,Float64},true,TrackedArray{…,Array{Float64,1}},ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::Tsit5) at .\none:0 [18] #solve at .\none:0 [inlined] [19] #diffeq_rd#1(::Array{Float64,1}, ::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol},NamedTuple{(:saveat,),Tuple{Float64}}}, ::Function, ::TrackedArray{…,Array{Float64,1}}, ::ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Nothing,ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::Tsit5) at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\src\Flux\layers.jl:13 [20] (::getfield(DiffEqFlux, Symbol("#kw##diffeq_rd")))(::NamedTuple{(:saveat,),Tuple{Float64}}, ::typeof(diffeq_rd), ::TrackedArray{…,Array{Float64,1}}, ::ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Nothing,ODEFunction{true,typeof(lotka_volterra),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::Tsit5) at .\none:0 [21] predict_rd() at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\test\layers.jl:18 [22] loss_rd() at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\test\layers.jl:20 [23] top-level scope at none:0 [24] include at .\boot.jl:326 [inlined] [25] include_relative(::Module, ::String) at .\loading.jl:1038 [26] include(::Module, ::String) at .\sysimg.jl:29 [27] include(::String) at .\client.jl:403 [28] top-level scope at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\test\runtests.jl:5 [29] top-level scope at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Test\src\Test.jl:1083 [30] top-level scope at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\test\runtests.jl:5 [31] include at .\boot.jl:326 [inlined] [32] include_relative(::Module, ::String) at .\loading.jl:1038 [33] include(::Module, ::String) at .\sysimg.jl:29 [34] include(::String) at .\client.jl:403 [35] top-level scope at none:0 [36] eval(::Module, ::Any) at .\boot.jl:328 [37] exec_options(::Base.JLOptions) at .\client.jl:243 [38] _start() at .\client.jl:436 in expression starting at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\test\layers.jl:21 Test Summary: | Error Total DiffEqFlux | 1 1 ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken. in expression starting at C:\Users\rand.julia\packages\DiffEqFlux\1w1tX\test\runtests.jl:3 ERROR: Package DiffEqFlux errored during testing

ChrisRackauckas commented 5 years ago

This was related to DiffEq v6.0 which put a bad norm on tracked values. This has new been fixed, a package update should work. Let me know if you need anything else.