Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sjohn4 committed Feb 17, 2025
1 parent dca05a3 commit 72184f3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions modyn/trainer_server/internal/trainer/pytorch_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,6 @@ def train(self) -> None: # pylint: disable=too-many-locals, too-many-branches
stopw.stop("Checkpoint")
if self._record_loss_every > 0 and trained_batches % self._record_loss_every == 0:
training_loss.append(loss.item())
print(loss.item())
# Log loss and batch number
log_file = self._checkpoint_path / "training_log.txt"
with (
open(log_file, "a") as f # pylint: disable=unspecified-encoding
): # 'a' mode appends if the file exists, else creates it
f.write(f"{trained_batches},{loss.item()}\n")
# Example: Logging training losses in a loop

self._num_samples += len(sample_ids)

stopw.start("OnBatchEnd", resume=True)
Expand Down
1 change: 0 additions & 1 deletion modyn/trainer_server/internal/utils/training_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def __init__(

self.shuffle = request.shuffle
self.enable_accurate_gpu_measurements = request.enable_accurate_gpu_measurements
self.generative = request.generative
assert (
self.pretrained_model_path or not self.use_pretrained_model
), "Inconsistent pretrained model configuration"
Expand Down

0 comments on commit 72184f3

Please sign in to comment.