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

Method _after_train

tensorpack/callbacks/concurrency.py:41–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 start_proc_mask_signal(self._procs_threads)
40
41 def _after_train(self):
42 if not self._stop_at_last:
43 return
44 for k in self._procs_threads:
45 if not k.is_alive():
46 continue
47 if isinstance(k, mp.Process):
48 logger.info("Stopping {} ...".format(k.name))
49 k.terminate()
50 k.join(5.0)
51 if k.is_alive():
52 logger.error("Cannot join process {}.".format(k.name))
53 elif isinstance(k, StoppableThread):
54 logger.info("Stopping {} ...".format(k.name))
55 k.stop()
56 k.join(5.0)
57 if k.is_alive():
58 logger.error("Cannot join thread {}.".format(k.name))

Callers

nothing calls this directly

Calls 3

formatMethod · 0.80
joinMethod · 0.80
stopMethod · 0.80

Tested by

no test coverage detected