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

Revise and lazy loading code / type GlobalRef has no field args #439

Closed
ablaom opened this issue Mar 4, 2020 · 0 comments · Fixed by #440
Closed

Revise and lazy loading code / type GlobalRef has no field args #439

ablaom opened this issue Mar 4, 2020 · 0 comments · Fixed by #440

Comments

@ablaom
Copy link

ablaom commented Mar 4, 2020

I get the error below when using Revise v2.5.3 and Revise v2.4.1, but it disappears in v2.3.3 (or if I simply don't load Revise)

The MLJModels @load macro below triggers loading of the DecisionTree package, which in turn triggers lazy loading of associated interface code from MLJModels (using Requires.jl).

This problem is not specific to the model DecisionTreeRegressor and its package, DecisionTree.jl. The issue is also there for @load KNNClassifier (from NearestNeighbors.jl package). But for some other models the issue is mysteriously absent.

julia> versioninfo()
Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.0.0)
  CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_PATH = /Applications/Julia-1.1.app/Contents/Resources/julia/bin/julia
julia> using Pkg

julia> Pkg.activate("junk")
Activating environment at `~/Dropbox/Julia7/MLJ/MLJTutorials/junk/Project.toml`

julia> Pkg.status()
    Status `~/Dropbox/Julia7/MLJ/MLJTutorials/junk/Project.toml`
  [7806a523] DecisionTree v0.10.1
  [d491faf4] MLJModels v0.8.3
  [295af30f] Revise v2.5.3

julia> using Revise, MLJModels
julia> @load DecisionTreeClassifier
┌ Error: evaluation error starting at /Users/anthony/.julia/packages/MLJModelInterface/lb8aH/src/model_def.jl:180
│   mod = MLJModels.DecisionTree_
│   ex =quote#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:31 =##= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:70 =# @mlj_model mutable struct DecisionTreeClassifier <: MMI.Probabilistic#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:71 =#
│                max_depth::Int = (-1)::(_ ≥ -1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:72 =#
│                min_samples_leaf::Int = 1::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:73 =#
│                min_samples_split::Int = 2::(_ ≥ 2)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:74 =#
│                min_purity_increase::Float64 = 0.0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:75 =#
│                n_subfeatures::Int = 0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:76 =#
│                post_prune::Bool = false#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:77 =#
│                merge_purity_threshold::Float64 = 1.0::(_ ≤ 1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:78 =#
│           DecisionTreeClassifier     pdf_smoothing::Float64 = 0.0::(0 ≤ _ ≤ 1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:79 =#
│                display_depth::Int = 5::(_ ≥ 1)endend
│   exception =
│    type GlobalRef has no field args
│    Stacktrace:
│     [1] getproperty(::GlobalRef, ::Symbol) at ./Base.jl:20
│     [2] #methods_by_execution!#20(::Bool, ::Bool, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::JuliaInterpreter.Frame, ::BitArray{1}) at /Users/anthony/.julia/packages/Revise/SZ4ae/src/lowered.jl:169
└ @ Revise ~/.julia/packages/Revise/SZ4ae/src/lowered.jl:106
(┌ Error: evaluation error starting at /Users/anthony/.julia/packages/MLJModelInterface/lb8aH/src/model_def.jl:180
│   mod = MLJModels.DecisionTree_
│   ex =quote#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:138 =##= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:154 =# @mlj_model mutable struct RandomForestClassifier <: MMI.Probabilistic#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:155 =#
│                max_depth::Int = (-1)::(_ ≥ -1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:156 =#
│                min_samples_leaf::Int = 1::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/
    hxnTt/src/DecisionTree.jl:157 =#
│                min_samples_split::Int = 2::(_ ≥ 2)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:158 =#
│                min_purity_increase::Float64 = 0.0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:159 =#
│                n_subfeatures::Int = 0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:160 =#
│                n_trees::Int = 10::(_ ≥ 2)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:161 =#
│                sampling_fraction::Float64 = 0.7::(0 < _ ≤ 1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:162 =#
│ ax_depth = [22m               pdf_smoothing::Float64 = 0.0::(0 ≤ _ ≤ 1)endend
│   exception =
│    type GlobalRef has no field args
│    Stacktrace:
│     [1] getproperty(::GlobalRef, ::Symbol) at ./Base.jl:20
│     [2] #methods_by_execution!#20(::Bool, ::Bool, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::JuliaInterpreter.Frame, ::BitArray{1}) at /Users/anthony/.julia/packages/Revise/SZ4ae/src/lowered.jl:169
└ @ Revise ~/.julia/packages/Revise/SZ4ae/src/lowered.jl:106
-1┌ Error: evaluation error starting at /Users/anthony/.julia/packages/MLJModelInterface/lb8aH/src/model_def.jl:180
│   mod = MLJModels.DecisionTree_
│   ex =quote#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:196 =##= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:206 =# @mlj_model mutable struct AdaBoostStumpClassifier <: MMI.Probabilistic#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:207 =#
│                n_iter::Int = 10::(_ ≥ 1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:208 =#
│                pdf_smoothing::Float64 = 0.0::(0 ≤ _ ≤ 1)endend
│   exception =
│    type GlobalRef has no field args
│    Stacktrace:
│     [1] getproperty(::GlobalRef, ::Symbol) at ./Base.jl:20
│     [2] #methods_by_execution!#20(::Bool, ::Bool, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::JuliaInterpreter.Frame, ::BitArray{1}) at /Users/anthony/.julia/packages/Revise/SZ4ae/src/lowered.jl:169
└ @ Revise ~/.julia/packages/Revise/SZ4ae/src/lowered.jl:106
,┌ Error: evaluation error starting at /Users/anthony/.julia/packages/MLJModelInterface/lb8aH/src/model_def.jl:180
│   mod = MLJModels.DecisionTree_
│   ex =quote#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:240 =##= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:260 =# @mlj_model mutable struct DecisionTreeRegressor <: MMI.Deterministic#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:261 =#
│                max_depth::Int = (-1)::(_ ≥ -1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:262 =#
│                min_samples_leaf::Int = 5::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/h
    xnTt/src/DecisionTree.jl:263 =#
│                min_samples_split::Int = 2::(_ ≥ 2)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:264 =#
│                min_purity_increase::Float64 = 0.0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:265 =#
│                n_subfeatures::Int = 0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:266 =#
│                post_prune::Bool = false#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:267 =#
│                merge_purity_threshold::Float64 = 1.0::(0 ≤ _ ≤ 1)endend
│   exception =
│ in_samples_leaf = 39m   type GlobalRef has no field args
│    Stacktrace:
│     [1] getproperty(::GlobalRef, ::Symbol) at ./Base.jl:20
│     [2] #methods_by_execution!#20(::Bool, ::Bool, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::JuliaInterpreter.Frame, ::BitArray{1}) at /Users/anthony/.julia/packages/Revise/SZ4ae/src/lowered.jl:169
└ @ Revise ~/.julia/packages/Revise/SZ4ae/src/lowered.jl:106
1┌ Error: evaluation error starting at /Users/anthony/.julia/packages/MLJModelInterface/lb8aH/src/model_def.jl:180
│   mod = MLJModels.DecisionTree_
│   ex =quote#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:294 =##= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:310 =# @mlj_model mutable struct RandomForestRegressor <: MMI.Deterministic#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:311 =#
│                max_depth::Int = (-1)::(_ ≥ -1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:312 =#
│                min_samples_leaf::Int = 1::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/h,xnTt/src/DecisionTree.jl:313 =#
│                min_samples_split::Int = 2::(_ ≥ 2)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:314 =#
│                min_purity_increase::Float64 = 0.0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:315 =#
│                n_subfeatures::Int = 0::(_ ≥ 0)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:316 =#
│                n_trees::Int = 10::(_ ≥ 2)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:317 =#
│                sampling_fraction::Float64 = 0.7::(0 < _ ≤ 1)#= /Users/anthony/.julia/packages/MLJModels/hxnTt/src/DecisionTree.jl:318 =#9m               pdf_smoothing::Float64 = 0.0::(0 ≤ _ ≤ 1)endend
│   exception =
│    type GlobalRef has no field args
│    Stacktrace:
│     [1] getproperty(::GlobalRef, ::Symbol) at ./Base.jl:20
│     [2] #methods_by_execution!#20(::Bool, ::Bool, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::JuliaInterpreter.Frame, ::BitArray{1}) at /Users/anthony/.julia/packages/Revise/SZ4ae/src/lowered.jl:169
└ @ Revise ~/.julia/packages/Revise/SZ4ae/src/lowered.jl:106
min_samples_split = 2,
    min_purity_increase = 0.0,
    n_subfeatures = 0,
    post_prune = false,
    merge_purity_threshold = 1.0,
    pdf_smoothing = 0.0,
    display_depth = 5) @ 161

julia> 
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

Successfully merging a pull request may close this issue.

1 participant