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.
| 179 | |
| 180 | |
| 181 | class 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 | |
| 200 | class LRScheduler(HookBase): |