On RemoveAllColumnsExceptForTransform, the size of the writables is expected to be different that the columns to keep

Author: nojuliangCreated Aug 7, 2024Updated Aug 7, 2024

Refering to this: https://github.com/deeplearning4j/deeplearning4j/blame/7c01957162ea55f19d5a406880434ab96770c339/datavec/datavec-api/src/main/java/org/datavec/api/transform/transform/column/RemoveAllColumnsExceptForTransform.java#L89C20-L89C20

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