You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
.It throws an error. The same thing happens if
w
in step 3. is replaced byFlux.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
From the looks of it, BSON searches for Tracker and Flux at the topmost level. Am I missing something here?
The text was updated successfully, but these errors were encountered: