You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py in init(self, dataset, batch_size, shuffle, sampler, batch_sampler, num_workers, collate_fn, pin_memory, drop_last, timeout, worker_init_fn, multiprocessing_context)
217 if batch_size is not None and batch_sampler is None:
218 # auto_collation without custom batch_sampler
--> 219 batch_sampler = BatchSampler(sampler, batch_size, drop_last)
220
221 self.batch_size = batch_size
C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\sampler.py in init(self, sampler, batch_size, drop_last)
184 raise ValueError("sampler should be an instance of "
185 "torch.utils.data.Sampler, but got sampler={}"
--> 186 .format(sampler))
187 if not isinstance(batch_size, _int_classes) or isinstance(batch_size, bool) or
188 batch_size <= 0:
ValueError: sampler should be an instance of torch.utils.data.Sampler, but got sampler=<class 'sampler.ImbalancedDatasetSampler'>
Was I supposed to save the sampler.py file in a special location? I saved it in my directory and it imports.
The text was updated successfully, but these errors were encountered:
Hello,
I'm getting the following error trying to use the Imbalanced data sampler.
ValueError Traceback (most recent call last)
in
----> 1 train_loader = DataLoader(roof, batch_size=10, sampler = ImbalancedDatasetSampler)
C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py in init(self, dataset, batch_size, shuffle, sampler, batch_sampler, num_workers, collate_fn, pin_memory, drop_last, timeout, worker_init_fn, multiprocessing_context)
217 if batch_size is not None and batch_sampler is None:
218 # auto_collation without custom batch_sampler
--> 219 batch_sampler = BatchSampler(sampler, batch_size, drop_last)
220
221 self.batch_size = batch_size
C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\sampler.py in init(self, sampler, batch_size, drop_last)
184 raise ValueError("sampler should be an instance of "
185 "torch.utils.data.Sampler, but got sampler={}"
--> 186 .format(sampler))
187 if not isinstance(batch_size, _int_classes) or isinstance(batch_size, bool) or
188 batch_size <= 0:
ValueError: sampler should be an instance of torch.utils.data.Sampler, but got sampler=<class 'sampler.ImbalancedDatasetSampler'>
Was I supposed to save the sampler.py file in a special location? I saved it in my directory and it imports.
The text was updated successfully, but these errors were encountered: