My model can't be transfered to gpu. Adapt.jl problem?

I have a model I’ve been working with and when I’m trying to expand it to work with arbitrary numbers of channels (some of which can be switched off) transfer to gpu keeps choking on the line:

sparams = ntuple(i->F.parameters[i], nsparams)

in base.jl in Adapt.jl, with an error message saying that a NTuple has to have at least 0 elements but it got -1. After trying to modify the code it instead said -2. Perhaps the Adapt module should detect the problem and give a more understandable error message.

Does anyone know what causes these problems?

It seems to me that it happens when trying to adapt a function (a closure defined within a let construct).

hard to help without a MWE

I understand that my question isn’t “debuggable”. I wrote it en lieu of a more complete question to see if this was a common problem with a known workaround / solution.

I’ll try to put together a MWE, but as my code is far from minimal this probably will take some time.

In the mean time, do you know what is meant by this comment?

## Closures
# two things can be captured: static parameters, and actual values (fields)

What is an example of a field of a closure?
What is an example of a static parameter of a closure?

Because closures are represented behind the scenes as anonymous Julia structs, any value a closure captures becomes on of the fields of that struct type. I believe static parameters here is referring to type parameters of the same struct type, which are required because the captured values could have arbitrary types. For more on this, see the official Julia documentation.

But to Carlo’s point, per Please read: make it easier to help you the very least we’d need is a full stacktrace if you’re unable to create a MWE. The next best thing to a MWE is a not-minimal working (i.e. runnable by a 3rd party) example, but note that the longer the reproducer the harder it will be to get help. But at least with a stacktrace and reproducible example, we might be able to help narrow things down to a MWE.

I have read “make it easier to…”. I don’t expect anyone to spend a lot of time on my problem under the circumstances. I will produce a minimal way to reproduce the problem as soon as I have opportunity and time, unless I discover the solution myself, in which case I will explain what caused the problem.

In the mean time, is there a more specific reference to the documentation mentioned above. The description of how closures are represented behind the scenes (presumably by Adapt or perhaps in general)?

2 Likes

I understand that, which is why the rest of that paragraph lists suggestions that might help without requiring a proper MWE up front. Are you not at liberty to even provide a stacktrace of the error you ran into? If so, then yes a MWE is the only option.

Julia Functions · The Julia Language, Types · The Julia Language, Style Guide · The Julia Language and more.

I’m not trying to be facetious but the comment I wrote and indeed this one, was away from office. I will absolutely provide a stack trace at the earliest opportune moment.

I have since (your reply) found a short paragraph in the documentation that closures are represented as structs. I am, however, not able to understand the whole picture from this alone (subject to my limeted skills in Julia programming).

More data will definitly be provided as soon as possible.

1 Like

Here is the stacktrace:

ERROR: LoadError: UndefVarError: empty_sym not defined
Stacktrace:
 [1] show(io::Base.TTY, frame::Base.StackTraces.StackFrame)
   @ Main ~/3Dto2D/v2/proj_net_v2_0.jl:53
 [2] show(io::Base.TTY, #unused#::MIME{Symbol("text/plain")}, x::Base.StackTraces.StackFrame)
   @ Base.Multimedia ./multimedia.jl:47
 [3] display(d::TextDisplay, M::MIME{Symbol("text/plain")}, x::Any)
   @ Base.Multimedia ./multimedia.jl:242
 [4] display(d::TextDisplay, x::Any)
   @ Base.Multimedia ./multimedia.jl:243
 [5] display(x::Any)
   @ Base.Multimedia ./multimedia.jl:328
 [6] train_and_evaluate(mfn::String, arguments::Vector{Int64}, modifications::Tuple{}, hyperparameters::Dict{Any, Any}; identifier::String)
   @ Main ~/3Dto2D/v2/proj_net_v2_0.jl:367
 [7] runfromfile(fn::String)
   @ Main ~/3Dto2D/v2/proj_net_v2_0.jl:448
 [8] top-level scope
   @ ~/3Dto2D/v2/proj_net_v2_0.jl:474
in expression starting at /home/johjo50/3Dto2D/v2/proj_net_v2_0.jl:458

caused by: ArgumentError: tuple length should be ≥ 0, got -2
Stacktrace:
  [1] _ntuple(f::Adapt.var"#1#3"{var"#coce#247"{Vector{Bool}}}, n::Int64)
    @ Base ./ntuple.jl:36
  [2] ntuple
    @ ./ntuple.jl:19 [inlined]
  [3] adapt_structure(to::Flux.FluxCUDAAdaptor, f::var"#coce#247"{Vector{Bool}})
    @ Adapt ~/.julia/packages/Adapt/LAQOx/src/base.jl:17
  [4] adapt(to::Flux.FluxCUDAAdaptor, x::Function)
    @ Adapt ~/.julia/packages/Adapt/LAQOx/src/Adapt.jl:40
  [5] (::Flux.var"#182#183")(x::Function)
    @ Flux ~/.julia/packages/Flux/js6mP/src/functor.jl:182
  [6] #fmap#17
    @ ~/.julia/packages/Functors/qBIlC/src/functor.jl:50 [inlined]
  [7] #18
    @ ~/.julia/packages/Functors/qBIlC/src/functor.jl:50 [inlined]
  [8] map(f::Functors.var"#18#19"{typeof(Flux._isleaf), typeof(Functors._default_walk), IdDict{Any, Any}, Functors.NoKeyword, Flux.var"#182#183"}, t::Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"})
    @ Base ./tuple.jl:224
  [9] _default_walk(f::Function, x::Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"})
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:43
 [10] fmap(f::Flux.var"#182#183", x::Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}; exclude::typeof(Flux._isleaf), walk::typeof(Functors._default_walk), cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [11] (::Functors.var"#18#19"{typeof(Flux._isleaf), typeof(Functors._default_walk), IdDict{Any, Any}, Functors.NoKeyword, Flux.var"#182#183"})(x::Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"})
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [12] map
    @ ./tuple.jl:221 [inlined]
 [13] map(::Function, ::NamedTuple{(:layers,), Tuple{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}})
    @ Base ./namedtuple.jl:219
 [14] _default_walk(f::Function, x::Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}})
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:43
 [15] fmap(f::Flux.var"#182#183", x::Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}; exclude::typeof(Flux._isleaf), walk::typeof(Functors._default_walk), cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [16] #18
    @ ~/.julia/packages/Functors/qBIlC/src/functor.jl:50 [inlined]
 [17] map
    @ ./tuple.jl:223 [inlined]
 [18] _default_walk
    @ ~/.julia/packages/Functors/qBIlC/src/functor.jl:43 [inlined]
 [19] fmap(f::Flux.var"#182#183", x::Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}; exclude::typeof(Flux._isleaf), walk::typeof(Functors._default_walk), cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50

To be continued…

This is more of the stacktrace…

[20] (::Functors.var"#18#19"{typeof(Flux._isleaf), typeof(Functors._default_walk), IdDict{Any, Any}, Functors.NoKeyword, Flux.var"#182#183"})(x::Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}})
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [21] map
    @ ./tuple.jl:222 [inlined]
 [22] map(::Function, ::NamedTuple{(:connection, :layers), Tuple{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}})
    @ Base ./namedtuple.jl:219
 [23] _default_walk(f::Function, x::Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}})
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:43
 [24] fmap(f::Flux.var"#182#183", x::Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}; exclude::typeof(Flux._isleaf), walk::typeof(Functors._default_walk), cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [25] #18
    @ ~/.julia/packages/Functors/qBIlC/src/functor.jl:50 [inlined]
 [26] map
    @ ./tuple.jl:223 [inlined]
 [27] _default_walk
    @ ~/.julia/packages/Functors/qBIlC/src/functor.jl:43 [inlined]
 [28] fmap(f::Flux.var"#182#183", x::Tuple{Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}, Flux.Dense{var"#σ#243", Matrix{Float32}, Vector{Float32}}, Flux.Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}; exclude::typeof(Flux._isleaf), walk::typeof(Functors._default_walk), cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [29] (::Functors.var"#18#19"{typeof(Flux._isleaf), typeof(Functors._default_walk), IdDict{Any, Any}, Functors.NoKeyword, Flux.var"#182#183"})(x::Tuple{Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}, Flux.Dense{var"#σ#243", Matrix{Float32}, Vector{Float32}}, Flux.Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}})
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [30] map
    @ ./tuple.jl:221 [inlined]
 [31] map(::Function, ::NamedTuple{(:layers,), Tuple{Tuple{Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}, Flux.Dense{var"#σ#243", Matrix{Float32}, Vector{Float32}}, Flux.Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}})
    @ Base ./namedtuple.jl:219
 [32] _default_walk(f::Function, x::Flux.Chain{Tuple{Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}, Flux.Dense{var"#σ#243", Matrix{Float32}, Vector{Float32}}, Flux.Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}})
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:43

To be continued…

Here’s some more stacktrace…

 [33] fmap(f::Flux.var"#182#183", x::Flux.Chain{Tuple{Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}, Flux.Dense{var"#σ#243", Matrix{Float32}, Vector{Float32}}, Flux.Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}; exclude::typeof(Flux._isleaf), walk::typeof(Functors._default_walk), cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
    @ Functors ~/.julia/packages/Functors/qBIlC/src/functor.jl:50
 [34] gpu
    @ ~/.julia/packages/Flux/js6mP/src/functor.jl:182 [inlined]
 [35] |>(x::Flux.Chain{Tuple{Flux.Parallel{var"#240#253", Tuple{Flux.Chain{Tuple{var"#tr_nil_f#246"}}, Flux.Chain{Tuple{var"#coce#247"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#236#248"}}, Flux.Chain{Tuple{var"#sace#250"{Vector{Bool}}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 2, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 2, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, Flux.Conv{2, 4, typeof(identity), Array{Float32, 4}, Bool}, Flux.BatchNorm{var"#σ#243", Vector{Float32}, Float32, Vector{Float32}}, Flux.Dropout{Float64, Colon, Random.TaskLocalRNG}, Flux.Conv{2, 4, var"#σ#243", Array{Float32, 4}, Vector{Float32}}, var"#238#251"}}}}, Flux.Dense{var"#σ#243", Matrix{Float32}, Vector{Float32}}, Flux.Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}, f::typeof(Flux.gpu))
    @ Base ./operators.jl:911                                                                                                               
 [36] train_and_evaluate(mfn::String, arguments::Vector{Int64}, modifications::Tuple{}, hyperparameters::Dict{Any, Any}; identifier::String)
    @ Main ~/3Dto2D/v2/proj_net_v2_0.jl:286
 [37] runfromfile(fn::String)
    @ Main ~/3Dto2D/v2/proj_net_v2_0.jl:448
 [38] top-level scope
    @ ~/3Dto2D/v2/proj_net_v2_0.jl:474
Exit Code 1                                                   

I assume that the LoadError is secondary to the ArgumentError. (Well, I don’t assume anything absolutely, I just think so)

I suspect that a closure is not being correctly treated in a recursive walk through the Flux model.

Is there anything that springs out on an ocular inspection?

Thanks!

The issue is that Adapt.jl/base.jl at v3.4.0 · JuliaGPU/Adapt.jl · GitHub doesn’t account for the case where a closure type has more fields than it does type parameters. To my knowledge, this is usually not the case because each captured variable will get a type parameter. However, it will happen if your code runs into Performance Tips · The Julia Language (explained further in https://github.com/JuliaLang/julia/issues/15276). We can demonstrate this quite easily:

julia> function outer(a, c)
           b = 1
           inner(x) = x + a + b + c
           b = 2
           return inner
       end
outer (generic function with 1 method)

julia> clos = outer(1, 3)
(::var"#inner#1"{Int64, Int64}) (generic function with 1 method)

julia> dump(clos)
inner (function of type var"#inner#1"{Int64, Int64})
  a: Int64 1
  c: Int64 3
  b: Core.Box
    contents: Int64 2

You can check this yourself by finding the closure object in your model which corresponds to (I presume) an inner function called coce and dumping it. I think this is also worth an issue on the Adapt.jl side to see if there’s an easy fix.

Thank you! This seems to be the explanation since this particular message goes away if I replace the closures with callable objects of a type that have a type that explicitly remembers (has member variables for) all things it should keep track of.

These members are a few numbers and CuArrays that never change and one CuArray that never changes shape put is used as a computational buffer.

Unfortunately, while I get passed this hurdle I still end up with a “CuArray only supports element types that are stored inline”. Could I assume that this is an independent error? (Perhaps a very hard question to answer.) What I mean is could I assume that the refactoring to callable objects isn’t likely to introduce the CuArray problem mentioned above?

If so I will try to turn it over for a bit and perhaps ask another question in this or some other channel (where does it belong?).

1 Like

That’s great to hear. I ended up filing `adapt_structure` can't handle `Box`es in closures · Issue #57 · JuliaGPU/Adapt.jl · GitHub, which the maintainers fixed very quickly. So hopefully this issue is encountered less often in future.

It should be. If you search for that error message on here, Slack and maybe GitHub issues, you should find a number of previous discussions with tips on how to debug the root cause and possible fixes though.