MCPcopy Create free account
hub / github.com/MetaSLAM/SphereVLAD / save_checkpoint

Method save_checkpoint

models/robotLCD.py:115–120  ·  view source on GitHub ↗
(self, epoch)

Source from the content-addressed store, hash-verified

113 self.scheduler.step()
114
115 def save_checkpoint(self, epoch):
116 state_dict = {"state_dict": self.model.state_dict(),
117 "optimizer": self.optimizer.state_dict(),
118 "epoch": epoch}
119 torch.save(state_dict,
120 '{}/pth/model_{}.pth'.format(self.config.OUTPUT.DIR, epoch))
121
122 def load_checkpoint(self, weight_path, resume=False):
123 checkpoint = torch.load(weight_path)

Callers 1

trainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected