MCPcopy Create free account
hub / github.com/coperception/star / resume

Method resume

star/utils/SegModule.py:26–43  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

24 self.com = config.com
25
26 def resume(self, path):
27 def map_func(storage, location):
28 return storage.cuda()
29
30 if os.path.isfile(path):
31 if rank == 0:
32 print("=> loading checkpoint '{}'".format(path))
33
34 checkpoint = torch.load(path, map_location=map_func)
35 self.model.load_state_dict(checkpoint["state_dict"], strict=False)
36
37 ckpt_keys = set(checkpoint["state_dict"].keys())
38 own_keys = set(model.state_dict().keys())
39 missing_keys = own_keys - ckpt_keys
40 for k in missing_keys:
41 print("caution: missing keys from checkpoint {}: {}".format(path, k))
42 else:
43 print("=> no checkpoint found at '{}'".format(path))
44
45 def step(self, data, num_agent, batch_size, loss=True):
46 bev = data["bev_seq"]

Callers

nothing calls this directly

Calls 3

printFunction · 0.85
load_state_dictMethod · 0.80
state_dictMethod · 0.80

Tested by

no test coverage detected