E0007: weight shape mismatch
What happened
The artifact declares a Dense layer with in_features × out_features weights, but the decoded base64 array has a different number of f32 values.
Why
The artifact is corrupt. The base64-decoded bytes decode successfully, but their length is inconsistent with the declared layer dimensions. Likely cause: truncated or modified artifact file.
How to fix
- Recompile from scratch:
thx.compile(model, "model.thx").
- Verify artifact integrity:
thrindex doctor --check model.thx. A CRC32 mismatch will accompany this error.
Example
Notes
Each f32 value is 4 bytes. If the decoded byte count is not divisible by 4, the error reports the byte count and the floor of bytes / 4.