-
Notifications
You must be signed in to change notification settings - Fork 184
Remove java.io.Serializable #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
334e81c
to
d1c3eac
Compare
throw new IllegalArgumentException("Unknown class in serialised model", e); | ||
} | ||
} | ||
Model<?> tmpModel = Model.deserializeFromFile(modelPath); | ||
Model<Label> model = tmpModel.castModel(Label.class); | ||
logger.info(String.format("Loading data from %s", datasetPath)); | ||
Dataset<Label> test; | ||
switch (o.inputFormat) { | ||
case SERIALIZED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this kind of a breaking change? Code that previously expected java serialization would not inadvertently be using a proto serialization path.
/** | ||
* Load in the model in protobuf format. | ||
*/ | ||
@Option(longName = "protobuf-model", usage = "Load the model from a protobuf. Optional") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again isn't this a breaking change? Code that was using this arg will now crash, even though it was doing things the 'right' way
@@ -217,30 +210,6 @@ public <T extends Output<T>> Pair<Dataset<T>,Dataset<T>> load(OutputFactory<T> o | |||
char separator; | |||
switch (inputFormat) { | |||
case SERIALIZED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another breaking change, as above
/** | ||
* Is the model stored in protobuf format? | ||
*/ | ||
@Option(longName="model-protobuf",usage="Is the model stored in protobuf format?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another breaking change as the option one above
/** | ||
* Is the serialized dataset in protobuf format? | ||
*/ | ||
@Option(longName="dataset-protobuf",usage="Is the serialized dataset a protobuf?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ibid
/** | ||
* Read and write protobuf formatted models. | ||
*/ | ||
@Option(longName = "model-protobuf", usage = "Read and write protobuf formatted models.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of places here where behavior changes for people who were already using protobuf models. We should think about how to handle that.
Description
Removes support for java.io.Serializable from all main Tribuo types. The only supported serialization mechanism is protobuf. Fixes #391.
Motivation
java.io.Serializable makes it difficult to migrate classes.