-
Notifications
You must be signed in to change notification settings - Fork 2
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
Dev shuffle data option #44
Conversation
if self.trainer.distributed_backend == 'ddp': | ||
batch_size = self.trainer.datamodule.batch_size | ||
if stage == 'fit': | ||
num_samples = self.trainer.datamodule.his_train.num_samples | ||
datasplit_name = 'train' | ||
elif stage == 'test': | ||
num_samples = self.trainer.datamodule.his_test.num_samples | ||
datasplit_name = 'test' | ||
else: | ||
# unknown stage | ||
log.warn(f'Unknown stage ({stage}) during setup!') | ||
num_samples = -1 | ||
datasplit_name = None | ||
|
||
if num_samples % self.trainer.datamodule.batch_size != 0: | ||
log.warn( | ||
f'Number of sample ({num_samples}) in {datasplit_name} not dividable by batch size ({batch_size}).') | ||
log.warn(f'Last batch will be incomplete. Behavior depends on datamodule.batch_drop_last setting.') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move it into the base_task but if we want to do that we have to name the datasets in a common fashion
… dataset inside the datamodule to test, train, and val
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as it should! gj
num_samples = self.trainer.datamodule.his_train.num_samples | ||
datasplit_name = 'train' | ||
elif stage == 'test': | ||
num_samples = self.trainer.datamodule.his_test.num_samples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use len(self.trainer.datamodule.his_train) instead of the num_samples field. Makes it more generic
Description
How to Test/Run?
python run.py
Something missing?
I don't think so