Skip to content

Commit

Permalink
Merge pull request #598 from Arch-W/main
Browse files Browse the repository at this point in the history
Bug fixed: adjusted the hyperparameters batch_size check for logging to TensorBoard.
  • Loading branch information
mittagessen authored May 2, 2024
2 parents ffe6de3 + a7910be commit 5fe2972
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kraken/lib/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ def validation_step(self, batch, batch_idx):
self.val_cer.update(pred, decoded_targets)
self.val_wer.update(pred, decoded_targets)

if self.logger and self.trainer.state.stage != 'sanity_check' and self.hparams.batch_size * batch_idx < 16:
for i in range(self.hparams.batch_size):
count = self.hparams.batch_size * batch_idx + i
if self.logger and self.trainer.state.stage != 'sanity_check' and self.hparams.hyper_params["batch_size"] * batch_idx < 16:
for i in range(self.hparams.hyper_params["batch_size"]):
count = self.hparams.hyper_params["batch_size"] * batch_idx + i
if count < 16:
self.logger.experiment.add_image(f'Validation #{count}, target: {decoded_targets[i]}',
batch['image'][i],
Expand Down

0 comments on commit 5fe2972

Please sign in to comment.