MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _before_train

Method _before_train

tensorpack/callbacks/steps.py:65–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

63 self._bar = None
64
65 def _before_train(self):
66 self._last_updated = self.local_step
67
68 self._total = self.trainer.steps_per_epoch
69 self._tqdm_args = get_tqdm_kwargs(leave=True)
70
71 self._fetches = self.get_tensors_maybe_in_tower(self._names) or None
72 if self._fetches:
73 for t in self._fetches:
74 assert t.shape.ndims == 0, "ProgressBar can only print scalars, not {}".format(t)
75 self._fetches = tf.train.SessionRunArgs(self._fetches)
76 self._tqdm_args['bar_format'] = self._tqdm_args['bar_format'] + "{postfix} "
77
78 def _before_epoch(self):
79 self._bar = tqdm.trange(self._total, **self._tqdm_args)

Callers

nothing calls this directly

Calls 3

get_tqdm_kwargsFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected