Skip to content

trainer.ModelCheckpoint cannot save: uses msgpack_from_state_dict (a restorer) as a file writer #95

@chaoming0625

Description

@chaoming0625

ModelCheckpoint._save_checkpoint calls braintools.file.msgpack_from_state_dict(checkpoint, filepath), but that function restores a state dict into a target (signature (target, state)); it does not serialize to a file. Saving a checkpoint through this callback raises.

Location: braintools/trainer/_callbacks.py (ModelCheckpoint._save_checkpoint).

Fix: use braintools.file.msgpack_save(filepath, checkpoint).

Found while adding test coverage (#90).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions