MCPcopy Create free account
hub / github.com/MotrixLab/insactor / load_pretrained

Method load_pretrained

diffplanner/models/transformers/actor.py:162–169  ·  view source on GitHub ↗
(self, ckpt_path)

Source from the content-addressed store, hash-verified

160 # return feature[0]
161
162 def load_pretrained(self, ckpt_path):
163 checkpoint = torch.load(ckpt_path, map_location='cpu')
164 motion_ckpt = OrderedDict()
165 for key in checkpoint['state_dict'].keys():
166 if key.startswith('motion_encoder'):
167 new_key = key[15:]
168 motion_ckpt[new_key] = checkpoint['state_dict'][key]
169 self.load_state_dict(motion_ckpt)
170
171
172@SUBMODULES.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected