Skip to content

RnnSequenceClassifier has null model after deserialization #74

@ooogood

Description

@ooogood

Describe the bug
RnnSequenceClassifier's member variable "isInitializationFinished" is not set at the end of member method "initializeClassifier(Instances data)".
Similar to the Dl4jMlpClassifier::initializeClassifier(Instances data), it should call Dl4jMlpClassifier::finishClassifierInitialization() at the end.

Otherwise, the "isInitializationFinished" flag will remain false, and the deserialized RnnSequenceClassifier object will have a null model. (Because in Dl4jMlpClassifier::writeObject, if the flag is not true, the model won't be serialized into the object file.)

To Reproduce
Steps to reproduce the behavior:

  1. Train a RnnSequenceClassifier like in this page: https://deeplearning.cms.waikato.ac.nz/examples/train_rnn/
  2. Serialize the classifier with SerializeHelper.write( "path/to/object/file", classifier)
  3. Deserialize the classifier with (RnnSequenceClassifier)SerializeHelper.read( "path/to/object/file" )
  4. The model in the classifier should be null.

Expected behavior
The model in the classifier should be the same as before the serialization.

Screenshots

Additional Information

  • Weka version: 3.8.6
  • wekaDeeplearning4j package version: v1.7.2
  • Operating System: Windows

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions