Loading Model Checkpoints

Load a PyTorch checkpoint into a model robustly when the state_dict nesting, key prefixes (model./module.), architecture, or input-channel count are uncertain. Use when a checkpoint silently loads onto random weights, load_state_dict reports missing/unexpected keys, a checkpoint comes from a different trainer (Lightning / DataParallel / raw torch), or you must infer the architecture and input channels before building the model. Picks the prefix variant by maximum key-overlap, prints missing/unexpected diagnostics, and flags the weights_only security caveat. Triggers: load a checkpoint, state_dict mismatch, missing/unexpected keys, strip module. prefix, wrong weights loaded, ckpt onto random weights.

vemodalen-x Updated 0 repo stars
VEMO_SKILLS skill lifecycle flow

File contents

vemodalen-x/VEMO_SKILLS commit 7d8ba132aa

Frequently asked questions

npx get-skill add vemodalen-x/loading-model-checkpoints