(self, path)
| 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"] |
nothing calls this directly
no test coverage detected