Comments (2)
train
is the 3rd argument so you have to change the static_argnums
like this:
MLP = nn.remat(MLP, static_argnums=(2,))
from flax.
I see. I guess I got confused because sometimes our models are used like this:
model.apply(variables, inputs, train=False)
which triggers this error:
ValueError: the `static_argnums` argument to `jax.checkpoint` / `jax.remat` can only take integer values greater than or equal to `-len(args)` and less than `len(args)`, but got (3,)
So I assumed it wasn't counting the self
argument. Any chance we could support something akin to static_argnames
from jax.jit
to support kwargs?
from flax.
Related Issues (20)
- `DynamicScale` behaves unexpected when computing per-sample gradients with `vmap`.
- bias and kernel params are put on different gpu devices HOT 1
- [nnx] How to access the nnx.Param which is inside of the Module HOT 2
- MNIST tutorial broken for Colab TPU
- Clarification for LSTMCell Documentation HOT 2
- nnx.initializers.uniform should support custom lower and upper bounds HOT 3
- SPMD for initializing model using nnx.jit HOT 1
- Flax dataclasses do not support new-style PRNGKeyArray in serialisation
- Add IndRNN HOT 1
- nn.WeightNorm needs a special scale_init to match PyTorch weight_norm HOT 1
- Experimental-pytree flag causes crash HOT 2
- Support for optax lbfgs and related optimizers with NNX HOT 1
- Discrepency between `jax.jit` and `nnx.jit` for `static_argnames` HOT 2
- `nnx.Dropout` in combination with `jax.lax.scan` returns an error
- Flax 0.9.0 broke nnx rng splitting HOT 2
- ToLinen is not hashable (Linen modules are) HOT 2
- How to freeze parameters with `nnx` and `optax`? HOT 7
- CHANGELOG has not been updated since 0.8.2
- Contributing to Flax Community Tutorials
- MultiHeadAttention documentation missing descriptions of `None` values for optional arguments
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flax.