Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroDivisionError in TensorboardWriter.set_step() #79

Open
Andry-Bal opened this issue Oct 31, 2020 · 2 comments
Open

ZeroDivisionError in TensorboardWriter.set_step() #79

Andry-Bal opened this issue Oct 31, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Andry-Bal
Copy link

There is a risk of getting ZeroDivisionError: float division by zero in TensorboardWriter.set_step() method in line:
self.add_scalar('steps_per_sec', 1 / duration.total_seconds())
I get this when running example config with "tensorboard": false

@chiragthakur93
Copy link

I get the same Zerodivisionerror, even with "tensorboard": true
Following is the error:

  File "G:\NewTemplate\pytorch-template-master\train.py", line 73, in <module>
    main(config)

  File "G:\NewTemplate\pytorch-template-master\train.py", line 54, in main
    trainer.train()

  File "G:\NewTemplate\pytorch-template-master\base\base_trainer.py", line 61, in train
    result = self._train_epoch(epoch)

  File "G:\NewTemplate\pytorch-template-master\trainer\trainer.py", line 68, in _train_epoch
    val_log = self._valid_epoch(epoch)

  File "G:\NewTemplate\pytorch-template-master\trainer\trainer.py", line 91, in _valid_epoch
    self.writer.set_step((epoch - 1) * len(self.valid_data_loader) + batch_idx, 'valid')

  File "G:\NewTemplate\pytorch-template-master\logger\visualization.py", line 48, in set_step
    self.add_scalar('steps_per_sec', 1 / duration.total_seconds())

ZeroDivisionError: float division by zero

@SunQpark SunQpark added the bug Something isn't working label Dec 10, 2020
@sixian-C
Copy link

I have the same issue, and I dont how to debug it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants