Skip to content
Snippets Groups Projects
Commit bf111e4e authored by Neta Zmora's avatar Neta Zmora
Browse files

data loading: fix a bug in choosing the data sampler

_get_sampler returned None if fixed_subset == False.
This was caused by a wrong indentation level such that
the case of fixed_subset == False was not handled leading
to _get_sampler returning None.

The bug was introduced yesterday, in commit
eb4da48b
parent 66e8b52d
No related branches found
No related tags found
No related merge requests found
......@@ -265,7 +265,7 @@ def _get_sampler(data_source, effective_size, fixed_subset=False, sequential=Fal
return SubsetSequentialSampler(subset_indices)
else:
return torch.utils.data.SubsetRandomSampler(subset_indices)
return SwitchingSubsetRandomSampler(data_source, effective_size)
return SwitchingSubsetRandomSampler(data_source, effective_size)
def get_data_loaders(datasets_fn, data_dir, batch_size, num_workers, validation_split=0.1, deterministic=False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment