On RemoveAllColumnsExceptForTransform, the size of the writables is expected to be different that the columns to keep
It is expected to have writables size >= inputSchema.numColumns()
So instead of
if (writables.size() != inputSchema.numColumns()) { throw new IllegalStateException("Cannot execute transform: input writables list length (" + writables.size() + ") does not " + "match expected number of elements (schema: " + inputSchema.numColumns() + "). Transform = " + toString()); }
shouldn't you have something like this:
if (writables.size() < inputSchema.numColumns()) { throw new IllegalStateException("Cannot execute transform: input writables list length (" + writables.size() + ") is less than " + "expected number of elements (schema: " + inputSchema.numColumns() + "). Transform = " + toString()); }
Source: deeplearning4j/deeplearning4j