deterministic torch.random.random_split #19944
Answered
by
adosar
mshooter
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
I am using
to create train, val,test split, however, I am testing the data on two different models which were trained pytroch lightning, but it is not splitting deterministically while I am setting seed_everything:42 How can I address this? |
Beta Was this translation helpful? Give feedback.
Answered by
adosar
Jun 8, 2024
Replies: 1 comment
-
What do you mean it does "not splitting deterministically"? This function is part of Pytorch and has nothing to do with Lightning. From the Pytorch docs: generator = torch.Generator().manual_seed(42)
random_split(range(10), [3, 7], generator=generator) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mshooter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What do you mean it does "not splitting deterministically"? This function is part of Pytorch and has nothing to do with Lightning.
From the Pytorch docs: