Visitar URL original
Fix CSVLogger: read existing learning_stats.csv file when resuming previous training by deruyter92 · Pull Request #3177 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reverting PR #3179 which breaks csv logging.
The header and previous rows are appended for every save call. This in unintended behavior.

- changing back to 'write' mode instead of 'append' mode
  • Loading branch information
deruyter92 committed Jan 16, 2026
commit ce2e26040b9c977e6aeded207f3610cab1ed393c
2 changes: 1 addition & 1 deletion deeplabcut/pose_estimation_pytorch/runners/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def log(self, metrics: dict[str, Any], step: Optional[int] = None) -> None:
def save(self):
"""Saves the metrics to the file system"""
logs = self._prepare_logs()
with open(self.log_file, "a", newline="") as f:
with open(self.log_file, "w", newline="") as f:
writer = csv.writer(f)
writer.writerows(logs)

Expand Down