E0004: layer dimension mismatch
What happened
Layer N in the artifact declares expected input features, but the preceding layer N-1 produces got output features. The two cannot be connected.
Why
The artifact is corrupt. This error should not occur if the artifact was produced by thx.compile(), because the compiler’s validate pass catches dimension mismatches at compile time with E0106. If you see E0004 at run time, the artifact was likely modified after compilation.
How to fix
- Recompile the model from scratch:
thx.compile(model, "model.thx").
- Verify artifact integrity before reporting a bug:
thrindex doctor --check model.thx.
- If
doctor --check reports a CRC32 mismatch, you will see E0009 as well — the artifact was tampered with.
Example
- E0106 — the compiler-time version of this error
- E0009 — CRC32 mismatch indicating tampering