MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / PeriodicCheckpointer

Class PeriodicCheckpointer

detectron2/engine/hooks.py:181–197  ·  view source on GitHub ↗

Same as :class:`detectron2.checkpoint.PeriodicCheckpointer`, but as a hook. Note that when used as a hook, it is unable to save additional data other than what's defined by the given `checkpointer`. It is executed every ``period`` iterations and after the last iteration.

Source from the content-addressed store, hash-verified

179
180
181class PeriodicCheckpointer(_PeriodicCheckpointer, HookBase):
182 """
183 Same as :class:`detectron2.checkpoint.PeriodicCheckpointer`, but as a hook.
184
185 Note that when used as a hook,
186 it is unable to save additional data other than what's defined
187 by the given `checkpointer`.
188
189 It is executed every ``period`` iterations and after the last iteration.
190 """
191
192 def before_train(self):
193 self.max_iter = self.trainer.max_iter
194
195 def after_step(self):
196 # No way to use **kwargs
197 self.step(self.trainer.iter)
198
199
200class LRScheduler(HookBase):

Callers 1

do_trainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected