Hi,
I have an optimization model, which I have run for a long time on my personal machine. When I run the same model on a cluster, it gives some errors. The error is as follows:
ERROR: LoadError: KeyError: key 1.0 not found
Stacktrace:
[1] getindex(#unused#::JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, key::Float64)
@ JuMP.Containers ~/.julia/packages/JuMP/b3hGi/src/Containers/DenseAxisArray.jl:18
[2] _getindex_recurse(data::Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}, keys::Tuple{Float64}, condition::JuMP.Containers.var"#8#10")
@ JuMP.Containers ~/.julia/packages/JuMP/b3hGi/src/Containers/DenseAxisArray.jl:250
[3] _getindex_recurse(data::Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}, keys::Tuple{Int64, Float64}, condition::JuMP.Containers.var"#8#10")
@ JuMP.Containers ~/.julia/packages/JuMP/b3hGi/src/Containers/DenseAxisArray.jl:249
[4] to_index(A::JuMP.Containers.DenseAxisArray{VariableRef, 2, Tuple{Vector{Int64}, Vector{Int64}}, Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}}, idx::Tuple{Int64, Float64})
@ JuMP.Containers ~/.julia/packages/JuMP/b3hGi/src/Containers/DenseAxisArray.jl:259
[5] getindex(::JuMP.Containers.DenseAxisArray{VariableRef, 2, Tuple{Vector{Int64}, Vector{Int64}}, Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}}, ::Int64, ::Float64)
@ JuMP.Containers ~/.julia/packages/JuMP/b3hGi/src/Containers/DenseAxisArray.jl:266
[6] macro expansion
@ ~/.julia/packages/MutableArithmetics/8xkW3/src/rewrite.jl:279 [inlined]
[7] macro expansion
@ ~/.julia/packages/JuMP/b3hGi/src/macros.jl:676 [inlined]
[8] (::var"#119#281"{JuMP.Containers.DenseAxisArray{VariableRef, 2, Tuple{Vector{Int64}, Vector{Int64}}, Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}}, JuMP.Containers.DenseAxisArray{VariableRef, 2, Tuple{Vector{Int64}, Vector{Int64}}, Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}}, Model})(g::Int64, t::Int64)
@ Main ~/.julia/packages/JuMP/b3hGi/src/Containers/macro.jl:194
[9] #38
@ ~/.julia/packages/JuMP/b3hGi/src/Containers/container.jl:105 [inlined]
[10] iterate
@ ./generator.jl:47 [inlined]
[11] collect(itr::Base.Generator{JuMP.Containers.VectorizedProductIterator{Tuple{Vector{Int64}, Vector{Int64}}}, JuMP.Containers.var"#38#39"{var"#119#281"{JuMP.Containers.DenseAxisArray{VariableRef, 2, Tuple{Vector{Int64}, Vector{Int64}}, Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}}, JuMP.Containers.DenseAxisArray{VariableRef, 2, Tuple{Vector{Int64}, Vector{Int64}}, Tuple{JuMP.Containers._AxisLookup{Dict{Int64, Int64}}, JuMP.Containers._AxisLookup{Dict{Int64, Int64}}}}, Model}}})
@ Base ./array.jl:678
[12] map(f::Function, A::JuMP.Containers.VectorizedProductIterator{Tuple{Vector{Int64}, Vector{Int64}}})
@ Base ./abstractarray.jl:2323
[13] container(f::Function, indices::JuMP.Containers.VectorizedProductIterator{Tuple{Vector{Int64}, Vector{Int64}}}, #unused#::Type{JuMP.Containers.DenseAxisArray})
@ JuMP.Containers ~/.julia/packages/JuMP/b3hGi/src/Containers/container.jl:105
[14] container(f::Function, indices::JuMP.Containers.VectorizedProductIterator{Tuple{Vector{Int64}, Vector{Int64}}})
@ JuMP.Containers ~/.julia/packages/JuMP/b3hGi/src/Containers/container.jl:66
[15] macro expansion
@ ~/.julia/packages/JuMP/b3hGi/src/macros.jl:142 [inlined]
[16] ExpansionModel()
@ Main ~/RenewableOpt/WECC-model/ExpansionModel.jl:232
[17] top-level scope
@ ~/RenewableOpt/WECC-model/Run.jl:20
in expression starting at /home/fkucuksayacigil/RenewableOpt/WECC-model/Run.jl:20
I feel that packages installed on my machine and the cluster are different versions, that is why errors show up. When I go to line 232 of ExpansionModel.jl, I realized that I am using Array() function. I feel that this is something changed from the version of Julia on my machine to the version of Julia on the cluster.
Could you please help me with this?
Kind regards