E-PE0004 — Invalid enum variant in serialized model
Error Type |
|
|---|---|
Phase |
loading a model via protobuf ( |
Python exception |
|
Message
Enum `{enum_type}` has the invalid variant `{variant}`; only {expected} are valid
Cause
A protobuf enum field carries a variant that is valid in the schema but that JijModeling does not accept in this position — for example a constraint sense of NotEqual, LessThan, or GreaterThan (only Equal, LessThanEqual, and GreaterThanEqual are valid constraint senses), or a Str/Scalar key type in a total dictionary (only partial dictionaries accept string or scalar keys).
Out-of-range enum values are reported as E-PE0002 and unparsable bytes as E-PE0007, so this error usually means the bytes were produced by external tooling rather than corrupted in transit.
Fix
Emit one of the variants listed in the message.
For constraints, use a non-strict sense (Equal, LessThanEqual, GreaterThanEqual); strict inequalities are not valid constraints in JijModeling.
For total-dictionary keys, use RangeNat, Variants, or CatLabel.
If the bytes were supposed to come from JijModeling’s to_protobuf, verify they were transferred without modification and re-export from the source.