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

Unclear error in active_yet_argminmax #421

Closed
gdalle opened this issue Sep 8, 2023 · 5 comments
Closed

Unclear error in active_yet_argminmax #421

gdalle opened this issue Sep 8, 2023 · 5 comments

Comments

@gdalle
Copy link
Contributor

gdalle commented Sep 8, 2023

While trying to debug #387, I ran into this error. I know there are NaNs somewhere in my code, but I'm not sure where it goes wrong

ERROR: BoundsError: attempt to access 1-element Vector{Float64} at index [-1]
Stacktrace:
  [1] getindex
    @ ./essentials.jl:13 [inlined]
  [2] getindex
    @ ~/.julia/packages/FrankWolfe/e97ZO/src/active_set.jl:48 [inlined]
  [3] #active_set_argminmax#84
    @ ~/.julia/packages/FrankWolfe/e97ZO/src/active_set.jl:271 [inlined]
  [4] active_set_argminmax
    @ ~/.julia/packages/FrankWolfe/e97ZO/src/active_set.jl:255 [inlined]
  [5] afw_step(x::Vector{Float64}, gradient::Vector{Float64}, lmo::InferOptFrankWolfeExt.LinearMaximizationOracleWithKwargs{typeof(ranking), Base.Pairs{Symbol, Matrix{Float32}, Tuple{Symbol}, NamedTuple{(:instance,), Tuple{Matrix{Float32}}}}}, active_set::FrankWolfe.ActiveSet{Vector{Int64}, Float64, Vector{Float64}}, epsilon::Float64, d::Vector{Float64}; memory_mode::FrankWolfe.InplaceEmphasis)
    @ FrankWolfe ~/.julia/packages/FrankWolfe/e97ZO/src/afw.jl:443
  [6] afw_step
    @ ~/.julia/packages/FrankWolfe/e97ZO/src/afw.jl:442 [inlined]
  [7] away_frank_wolfe(f::DifferentiableFrankWolfe.var"#obj#12"{Vector{Float32}, InferOptFrankWolfeExt.var"#f#3"{typeof(half_square_norm)}}, grad!::DifferentiableFrankWolfe.var"#grad!#13"{Vector{Float32}, InferOptFrankWolfeExt.var"#f_grad1#4"{typeof(identity)}}, lmo::InferOptFrankWolfeExt.LinearMaximizationOracleWithKwargs{typeof(ranking), Base.Pairs{Symbol, Matrix{Float32}, Tuple{Symbol}, NamedTuple{(:instance,), Tuple{Matrix{Float32}}}}}, active_set::FrankWolfe.ActiveSet{Vector{Int64}, Float64, Vector{Float64}}; line_search::FrankWolfe.Adaptive{Float64, Int64}, lazy_tolerance::Float64, epsilon::Float64, away_steps::Bool, lazy::Bool, momentum::Nothing, max_iteration::Int64, print_iter::Int64, trajectory::Bool, verbose::Bool, memory_mode::FrankWolfe.InplaceEmphasis, gradient::Nothing, renorm_interval::Int64, callback::Nothing, traj_data::Vector{Any}, timeout::Float64, extra_vertex_storage::Nothing, add_dropped_vertices::Bool, use_extra_vertex_storage::Bool, linesearch_workspace::Nothing, recompute_last_vertex::Bool)
    @ FrankWolfe ~/.julia/packages/FrankWolfe/e97ZO/src/afw.jl:228
  [8] away_frank_wolfe
    @ ~/.julia/packages/FrankWolfe/e97ZO/src/afw.jl:72 [inlined]
  [9] #away_frank_wolfe#106
    @ ~/.julia/packages/FrankWolfe/e97ZO/src/afw.jl:41 [inlined]
 [10] away_frank_wolfe
    @ ~/.julia/packages/FrankWolfe/e97ZO/src/afw.jl:10 [inlined]
@matbesancon
Copy link
Member

Do you have access to the function that was called / a MWE?

@gdalle
Copy link
Contributor Author

gdalle commented Sep 8, 2023

Unfortunately the MWE is rather involved, trying to debug it right now. But I thought it would already be useful to know that an end user can encounter this error. I'd love for it to be a little more explicit

@matbesancon
Copy link
Member

yes it shouldn't happen, I could suspect the NaNs

@matbesancon
Copy link
Member

because: julia> NaN < Inf

@gdalle
Copy link
Contributor Author

gdalle commented Sep 10, 2023

fixed

@gdalle gdalle closed this as completed Sep 10, 2023
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

2 participants