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

MethodError: ReverseDiff.TrackedReal ... is ambiguous. #217

Open
prbzrg opened this issue Feb 6, 2023 · 0 comments
Open

MethodError: ReverseDiff.TrackedReal ... is ambiguous. #217

prbzrg opened this issue Feb 6, 2023 · 0 comments

Comments

@prbzrg
Copy link

prbzrg commented Feb 6, 2023

I got an error when I used Zygote over ReverseDiff for a neural ODE

  Test threw exception
  Expression: !(isnothing(Zygote.gradient(diff_loss, ps)))
  MethodError: ReverseDiff.TrackedReal{ForwardDiff.Dual{ForwardDiff.Tag{ODEFunction{false, SciMLBase.FullSpecialize, ICNF.var"#f_aug#48"{AbstractDifferentiation.ReverseDiffBackend, Planar{Float64, Array}, NamedTuple{(), Tuple{}}, Int64}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Float64}, Float64, 2}, ForwardDiff.Dual{ForwardDiff.Tag{ODEFunction{false, SciMLBase.FullSpecialize, ICNF.var"#f_aug#48"{AbstractDifferentiation.ReverseDiffBackend, Planar{Float64, Array}, NamedTuple{(), Tuple{}}, Int64}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Float64}, Float64, 2}, Nothing}(::ForwardDiff.Dual{ForwardDiff.Tag{ODEFunction{false, SciMLBase.FullSpecialize, ICNF.var"#f_aug#48"{AbstractDifferentiation.ReverseDiffBackend, Planar{Float64, Array}, NamedTuple{(), Tuple{}}, Int64}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Float64}, Float64, 2}) is ambiguous. Candidates:
    (T::Type{<:Real})(x::ForwardDiff.Dual) in Tracker at /home/runner/.julia/packages/Tracker/9xWLl/src/lib/real.jl:110
    ReverseDiff.TrackedReal{V, D, O}(value) where {V, D, O} in ReverseDiff at /home/runner/.julia/packages/ReverseDiff/YkVxM/src/tracked.jl:56
  Possible fix, define
    ReverseDiff.TrackedReal{V, D, O}(::ForwardDiff.Dual) where {V, D, O}

I don't know how to reproduce it with a simple code, If it can't be fixed without the original code; please close this issue.

Stacktrace:
https://github.com/impICNF/ICNF.jl/actions/runs/4099293121/jobs/7069064588#step:6:1680

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

1 participant