I am trying something like the following and the error I get is ERROR: UndefVarError: Tracker not defined
Steps to replicate this -
Let ExampleModule.jl file be the following
module ExampleModule
using BSON, Tracker, Flux
include("./file1.jl")
end
And here is the code in file1.jl
function load_weights(path) # Loading weights
c = BSON.load(path)
return c
end
Create and save weights like using Flux; using BSON: @save;,w = param(rand(2,2)) and then @save "wt.bson" w.
In a new REPL session , if I do the following -
julia> include("ExampleModule.jl")
julia> ExampleModule.load_weights("wt.bson")
ERROR: UndefVarError: Tracker not defined
It throws an error. The same thing happens if `w` in step 3. is replaced by `Flux.Conv` as well.
Also if I do `using Tracker, Flux` at the top level (i.e. in REPL session - step 4.) this starts working fine. Exporting Tracker and Flux also work fine, except for the tests.
The above example is a simplified version to recreate the error I am facing in JuliaText/TextAnalysis.jl#167
## Other Info
Flux v0.8.3
BSON v0.2.3
Julia 1.0.3
OS - Ubuntu 18.04.2 LTS - 64-bit although with Travis CI, doesn't work on osx.
From the looks of it, BSON searches for Tracker and Flux at the topmost level. Am I missing something here?
I am trying something like the following and the error I get is
ERROR: UndefVarError: Tracker not defined
Steps to replicate this -
ExampleModule.jl
file be the followingfile1.jl
using Flux; using BSON: @save;
,w = param(rand(2,2))
and then@save "wt.bson" w
.julia> ExampleModule.load_weights("wt.bson") ERROR: UndefVarError: Tracker not defined
Flux v0.8.3 BSON v0.2.3 Julia 1.0.3 OS - Ubuntu 18.04.2 LTS - 64-bit although with Travis CI, doesn't work on osx.