Submodule Sequential must be defined in setup()
or in a method wrapped in @compact
#1391
-
I'm working on a Flax implementation for gMLP (gated MLP) from Pay Attention to MLPs. My work so far is in SauravMaheshkar/gMLP and is based on lucidrains' implementations. I've made a simple
And I've been getting this error message Error Message
The problem lies in the
Even though the module is defined with Any help would be much appreciated 😊. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Tunnel Vision got to me 😅. I wasn't passing a list of modules. I was doing something like |
Beta Was this translation helpful? Give feedback.
Tunnel Vision got to me 😅. I wasn't passing a list of modules. I was doing something like
Sequential(Dense(), LayerNorm())
instead ofSequential([Dense(), LayerNorm()])
. Closing the discussion.