Create SessionRunHooks for all callbacks, and hook it onto `self.sess` to create `self.hooked_sess`. A new trainer may override this method to create multiple groups of hooks, which can be useful when the training is not done by a single `train_op`.
(self)
| 242 | |
| 243 | @call_only_once |
| 244 | def initialize_hooks(self): |
| 245 | """ |
| 246 | Create SessionRunHooks for all callbacks, and hook it onto `self.sess` to create `self.hooked_sess`. |
| 247 | |
| 248 | A new trainer may override this method to create multiple groups of hooks, |
| 249 | which can be useful when the training is not done by a single `train_op`. |
| 250 | """ |
| 251 | hooks = self._callbacks.get_hooks() |
| 252 | self.hooked_sess = tfv1.train.MonitoredSession( |
| 253 | session_creator=ReuseSessionCreator(self.sess), hooks=hooks) |
| 254 | |
| 255 | @call_only_once |
| 256 | def main_loop(self, steps_per_epoch, starting_epoch, max_epoch): |
no test coverage detected