Manages the list of the latest checkpoints.
(self, latest_save_path)
| 1181 | return name |
| 1182 | |
| 1183 | def _RecordLastCheckpoint(self, latest_save_path): |
| 1184 | """Manages the list of the latest checkpoints.""" |
| 1185 | if not self.saver_def.max_to_keep: |
| 1186 | return |
| 1187 | # Remove first from list if the same name was used before. |
| 1188 | for p in self._last_checkpoints: |
| 1189 | if latest_save_path == self._CheckpointFilename(p): |
| 1190 | self._last_checkpoints.remove(p) |
| 1191 | # Append new path to list |
| 1192 | self._last_checkpoints.append((latest_save_path, time.time())) |
| 1193 | |
| 1194 | # If more than max_to_keep, remove oldest. |
| 1195 | if len(self._last_checkpoints) > self.saver_def.max_to_keep: |
| 1196 | self._checkpoints_to_be_deleted.append(self._last_checkpoints.pop(0)) |
| 1197 | |
| 1198 | def _MaybeDeleteOldCheckpoints(self, meta_graph_suffix="meta"): |
| 1199 | """Deletes old checkpoints if necessary. |