ignored_keys can just ignore the given keys from both loaded state_dict and own_state like: def load_state_dict(self, state_dict, ignored_keys=[]): """Copies parameters and buffers from :attr:`state_dict` into this module and its descendants. The keys of :attr:`state_dict` must exac...
@elbaronote that the original feature proposal was not to ignore incompatible shapes silently. It should return information about mismatches. This would allow users to handle them manually: overwrite, ignore, reshape, transpose, etc, and would be better than just an "overwrite_..." option....
Whitespace Ignore whitespace Split Unified python/paddle/distributed/checkpoint load_state_dict.py metadata.py save_state_dict.py 47 changes: 33 additions & 14 deletions 47 python/paddle/distributed/checkpoint/load_state_dict.py Original file line numberDiff line numberDiff line change @@ -32...
Whitespace Ignore whitespace Split Unified 2 changes: 1 addition & 1 deletion 2 metric_depth/zoedepth_depth_anything/models/model_io.py Original file line numberDiff line numberDiff line change @@ -57,7 +57,7 @@ def load_wts(model, checkpoint_path): def load_state_dict_from_url(model...
Whitespace Ignore whitespace Split Unified 72 changes: 72 additions & 0 deletions 72 helpers.py Original file line numberDiff line numberDiff line change @@ -1,3 +1,5 @@ import json import os from collections import defaultdict import torch @@ -21,6 +23,76 @@ def defaultdict_from_jso...