Closed
Description
I'm trying to make a module with MLJModel:
module Abc
import XGBoost: dump_model, save, Booster
using MLJ
using MLJBase
import MLJModels
using MLJModels.XGBoost_
function __init__()
@info "Abc"
end
end
but having an error ERROR: LoadError: UndefVarError: XGBoost_ not defined
.
Looks like there is an issue with lazy activation in
@require XGBoost = "009559a3-9522-5dbb-924b-0b6ed2b22bb9" include("XGBoost.jl")
One workaround I found is
module Abc
using XGBoost
#import XGBoost: dump_model, save, Booster
using MLJ
using MLJBase
import MLJModels
include(joinpath(MLJModels.srcdir, "XGBoost.jl"))
#using MLJModels.XGBoost_
function __init__()
@info "Abc"
end
end
Also I added debug output into function __init__
of the module MLJModels and I see that this method is called twice. I have something like:
[ Info: Precompiling Abc [top-level]
[ Info: MLJModels!!!
[ Info: MLJModels!!!
[ Info: Abc
May be it is related to a chain of __init__
methods.
Metadata
Metadata
Assignees
Labels
No labels