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

Fixed val interval #405

Merged
merged 7 commits into from
Oct 22, 2019
Merged

Fixed val interval #405

merged 7 commits into from
Oct 22, 2019

Conversation

williamFalcon
Copy link
Contributor

@williamFalcon williamFalcon commented Oct 21, 2019

Fixes #348

To use:

Trainer(val_check_interval=100)

(checks val every 100 train batches interval)

@williamFalcon williamFalcon merged commit 792ad00 into master Oct 22, 2019
@williamFalcon williamFalcon deleted the fixed_val_interval branch October 22, 2019 08:29
@@ -15,8 +18,11 @@ class TrainerDataLoadingMixin(object):
def layout_bookeeping(self):

# determine number of training batches
self.nb_training_batches = len(self.get_train_dataloader())
self.nb_training_batches = int(self.nb_training_batches * self.train_percent_check)
if isinstance(self.get_train_dataloader(), IterableDataset):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs to be isinstance(self.get_train_dataloader().dataset, IterableDataset)

self.nb_training_batches = len(self.get_train_dataloader())
self.nb_training_batches = int(self.nb_training_batches * self.train_percent_check)
if isinstance(self.get_train_dataloader(), IterableDataset):
self.nb_training_batches = float('inf')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and tqdm crashes because of the float('inf')

@Borda
Copy link
Member

Borda commented Nov 21, 2019

@ibeltagy to late, it is already merged... 8-/

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

Successfully merging this pull request may close these issues.

Support running validation every fixed number of examples
3 participants