MCPcopy
hub / github.com/thuml/Transfer-Learning-Library / get_checkpoint_path

Method get_checkpoint_path

tllib/utils/logger.py:86–99  ·  view source on GitHub ↗

Get the full checkpoint path. Args: name (optional): the filename (without file extension) to save checkpoint. If None, when the phase is ``train``, checkpoint will be saved to ``{epoch}.pth``. Otherwise, will be saved to ``{phase}.pth``.

(self, name=None)

Source from the content-addressed store, hash-verified

84 return os.path.join(self.visualize_directory, self._get_phase_or_epoch(), filename)
85
86 def get_checkpoint_path(self, name=None):
87 """
88 Get the full checkpoint path.
89
90 Args:
91 name (optional): the filename (without file extension) to save checkpoint.
92 If None, when the phase is ``train``, checkpoint will be saved to ``{epoch}.pth``.
93 Otherwise, will be saved to ``{phase}.pth``.
94
95 """
96 if name is None:
97 name = self._get_phase_or_epoch()
98 name = str(name)
99 return os.path.join(self.checkpoint_directory, name + ".pth")
100
101 def close(self):
102 self.logger.close()

Callers 15

mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95

Calls 1

_get_phase_or_epochMethod · 0.95

Tested by

no test coverage detected