We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I am trying to optimize User-defined function and I got this error:
ERROR: LoadError: MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{getfield(JuMP, Symbol("##84#86")){typeof(min_f)},Float64},Float64,11}) Closest candidates are: Float64(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:194 Float64(::T<:Number) where T<:Number at boot.jl:741 Float64(::Int8) at float.jl:60 ... Stacktrace: [1] convert(::Type{Float64}, ::ForwardDiff.Dual{ForwardDiff.Tag{getfield(JuMP, Symbol("##84#86")){typeof(min_f)},Float64},Float64,11}) at ./number.jl:7 [2] setindex! at ./array.jl:769 [inlined] [3] MC36SM_Mindaugo_SS(::Float64, ::NTuple{32,ForwardDiff.Dual{ForwardDiff.Tag{getfield(JuMP, Symbol("##84#86")){typeof(min_f)},Float64},Float64,11}}, ::Array{Float64,1}, ::Float64, ::Float64) at /home/kest/Projects/gjJulia/testMC36SM.jl:90
Looks like that it is because of trying to do (in User-defined function for JuMP):
g = zeros(36, 4); ..... g[.....,.....] = Go[1]
g type is 2D Array of Float64, but Go[1] (optimization variable) passed by JuMP autodiff type is:
Dual{ForwardDiff.Tag{getfield(JuMP, Symbol("##84#86")){typeof(min_f)},Float64}}(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0)
Any ideas how to solve such type mismatch?
The text was updated successfully, but these errors were encountered:
This was answered at https://discourse.julialang.org/t/dual-forwarddiff-type-error-when-jump-tries-autodiff-user-defined-function/25639/2. In the future, please cross-link when double posting a question.
Sorry, something went wrong.
Ok.
No branches or pull requests
Hello, I am trying to optimize User-defined function and I got this error:
Looks like that it is because of trying to do (in User-defined function for JuMP):
g type is 2D Array of Float64, but Go[1] (optimization variable) passed by JuMP autodiff type is:
Any ideas how to solve such type mismatch?
The text was updated successfully, but these errors were encountered: