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: float division by zero #4

Open
rahulmool opened this issue Apr 1, 2023 · 1 comment
Open

ZeroDivisionError: float division by zero #4

rahulmool opened this issue Apr 1, 2023 · 1 comment

Comments

@rahulmool
Copy link

When i run run_xict.sh I get the following error:-

Traceback (most recent call last):
File "run_xict.py", line 600, in
main()
File "run_xict.py", line 590, in main
trainer.run_train()
File "run_xict.py", line 132, in run_train
self._train_epoch(scheduler, epoch, eval_step, train_iterator)
File "run_xict.py", line 363, in _train_epoch
self.validate_and_save(epoch, train_data_iterator.get_iteration(), scheduler)
File "run_xict.py", line 148, in validate_and_save
validation_loss = self.validate_nll()
File "run_xict.py", line 185, in validate_nll
total_loss = total_loss / batches
ZeroDivisionError: float division by zero

What should I do?

@khuangaf
Copy link
Owner

khuangaf commented Apr 2, 2023

It's likely that the dev data is not loaded properly, causing batches to be zero. You should check this line and see if the data loader is correct https://github.com/khuangaf/CONCRETE/blob/master/CORA/mDPR/run_xict.py#L164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants