E0106: layer dimension mismatch
What happened
During the compiler’s validate pass, it found that layer N expects expected input features, but layer N-1 produces got output features. The two layers cannot be connected.
Why
The most common cause: you changed the size of one layer but forgot to update the adjacent layer.
For example:
How to fix
- Check each
Dense layer — out_features of layer N must match in_features of layer N+2 (accounting for the LIF layer in between).
- Use a consistent naming pattern, e.g.
hidden_size = 512, and reference the variable throughout:
Example