deeplearning4j/deeplearning4j · error · RuntimeException

Unknown/not implemented normalization type:

Error message

Unknown/not implemented normalization type: 

What it means

Thrown by TransformProcess.Builder.normalize(String, Normalize, DataAnalysis) when the Normalize enum value passed in falls through the switch's default branch. The library only implements six normalization types (MinMax, MinMax2, Standardize, SubtractMean, Log2Mean, Log2MeanExcludingMin); any other value cannot be mapped to a Normalizer. In practice this fires only when a new Normalize constant from a newer DataVec version is deserialized/used against an older build, or when code constructs the enum dynamically.

Solutions

  1. Check the Normalize value you pass to normalize() is one of MinMax, MinMax2, Standardize, SubtractMean, Log2Mean, Log2MeanExcludingMin.
  2. Align datavec-api versions: use the same (or newer) datavec version at runtime as the one that serialized the TransformProcess.
  3. If a new Normalize constant is needed, add a case to the switch in TransformProcess.Builder.normalize implementing the mapping to a Normalizer.
  4. Validate pipeline JSON before loading: enumerate the normalize types it references and confirm each exists in your runtime's Normalize enum.

Example fix

// before (newer enum constant on older runtime)
builder.normalize("col", Normalize.SomeNewType, analysis); // RuntimeException
// after
builder.normalize("col", Normalize.MinMax2, analysis); // or upgrade datavec-api on the runtime
Defensive patterns

Strategy: validation

Validate before calling

Set<Normalize> SUPPORTED = EnumSet.of(Normalize.MinMax, Normalize.MinMax2, Normalize.Standardize,
        Normalize.SubtractMean, Normalize.Log2Mean, Normalize.Log2MeanExcludingMin);
if (!SUPPORTED.contains(type)) throw new IllegalArgumentException("Unsupported Normalize type: " + type);
// and verify pipeline JSON normalize types against Normalize.valueOf(...) before loading

Type guard

boolean isSupportedNormalize(Normalize t) {
    return t == Normalize.MinMax || t == Normalize.MinMax2 || t == Normalize.Standardize
        || t == Normalize.SubtractMean || t == Normalize.Log2Mean || t == Normalize.Log2MeanExcludingMin;
}

Try / catch

try {
    builder.normalize(column, type, analysis);
} catch (RuntimeException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("Unknown/not implemented normalization type")) {
        log.error("Normalize type {} unsupported by this datavec version; upgrade datavec-api or use a supported type", type);
    } else throw e;
}

Prevention

When it happens

Trigger: Calling Builder.normalize(column, type, da) with a Normalize value not handled by the switch in TransformProcess.java:1013-1042. Since the enum currently has exactly the six handled constants, the realistic trigger is a version mismatch: a TransformProcess serialized (e.g. via LegacyJsonFormat) with a newer Normalize constant is loaded by an older jar, or reflection/dynamic code supplies an unexpected constant.

Common situations: Deploying a serialized DataVec pipeline (JSON/yaml config) created with a newer datavec version onto a runtime with an older datavec-api jar on the classpath; fat-jar shading that pins an old datavec-api; manually editing pipeline JSON to add a normalization type.

Related errors


AI-assisted analysis of deeplearning4j/deeplearning4j@4c22ac5fe4 (2026-09-07). Data as JSON: /api/errors/6694ced04d450632. Report an issue: GitHub.

Appendix: source

Thrown at datavec/datavec-api/src/main/java/org/datavec/api/transform/TransformProcess.java:1042

                case Log2MeanExcludingMin:
                    long countMin = nca.getCountMinValue();

                    //mean including min value: (sum/totalCount)
                    //mean excluding min value: (sum - countMin*min)/(totalCount - countMin)
                    double meanExMin;
                    if (ca.getCountTotal() - countMin == 0) {
                        if (ca.getCountTotal() == 0) {
                            log.warn("Normalizing with Log2MeanExcludingMin but 0 records present in analysis");
                        } else {
                            log.warn("Normalizing with Log2MeanExcludingMin but all records are the same value");
                        }
                        meanExMin = mean;
                    } else {
                        meanExMin = (mean * ca.getCountTotal() - countMin * min) / (ca.getCountTotal() - countMin);
                    }
                    return transform(new Log2Normalizer(column, meanExMin, min, 0.5));
                default:
                    throw new RuntimeException("Unknown/not implemented normalization type: " + type);
            }
        }

        /**
         * Convert a set of independent records/examples into a sequence, according to some key.
         * Within each sequence, values are ordered using the provided {@link SequenceComparator}
         *
         * @param keyColumn  Column to use as a key (values with the same key will be combined into sequences)
         * @param comparator A SequenceComparator to order the values within each sequence (for example, by time or String order)
         */
        public Builder convertToSequence(String keyColumn, SequenceComparator comparator) {
            actionList.add(new DataAction(new ConvertToSequence(keyColumn, comparator)));
            return this;
        }

        /**
         * Convert a set of independent records/examples into a sequence; each example is simply treated as a sequence
         * of length 1, without any join/group operations. Note that more commonly, joining/grouping is required;

View on GitHub (pinned to 4c22ac5fe4)