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
I am trying to run a dataloader .show_batch() but getting an attribute error:
dls.show_batch()
File env/lib/python3.10/site-packages/fastai/data/core.py:100, in TfmdDL.show_batch(self, b, max_n, ctxs, show, unique, **kwargs)
98 old_get_idxs = self.get_idxs
99 self.get_idxs = lambda: Inf.zeros
--> 100 if b is None: b = self.one_batch()
101 if not show: return self._pre_show_batch(b, max_n=max_n)
102 show_batch(*self._pre_show_batch(b, max_n=max_n), ctxs=ctxs, max_n=max_n, **kwargs)
File env/lib/python3.10/site-packages/fastai/data/load.py:137, in DataLoader.one_batch(self)
135 def one_batch(self):
136 if self.n is not None and len(self)==0: raise ValueError(f'This DataLoader does not contain any batches')
--> 137 with self.fake_l.no_multiproc(): res = first(self)
138 if hasattr(self, 'it'): delattr(self, 'it')
139 return res
File env/lib/python3.10/site-packages/fastcore/basics.py:660, in first(x, f, negate, **kwargs)
658 x = iter(x)
659 if f: x = filter_ex(x, f=f, negate=negate, gen=True, **kwargs)
--> 660 return next(x, None)
File env/lib/python3.10/site-packages/fastai/data/load.py:101, in DataLoader.__iter__(self)
99 self.before_iter()
100 self.__idxs=self.get_idxs() # called in context of main process (not workers/subprocesses)
--> 101 for b in _loaders[self.fake_l.num_workers==0](self.fake_l):
102 if self.device is not None: b = to_device(b, self.device)
103 yield self.after_batch(b)
File env/lib/python3.10/site-packages/torch/utils/data/dataloader.py:659, in _SingleProcessDataLoaderIter.__init__(self, loader)
658 def __init__(self, loader):
--> 659 super().__init__(loader)
660 assert self._timeout == 0
661 assert self._num_workers == 0
File env/lib/python3.10/site-packages/torch/utils/data/dataloader.py:587, in _BaseDataLoaderIter.__init__(self, loader)
583 self._rank = rank
584 # for other backends, pin_memory_device need to set. if not set
585 # default behaviour is CUDA device. if pin_memory_device is selected
586 # and pin_memory is not set, the default behaviour false.
--> 587 if (len(loader.pin_memory_device) == 0):
588 self._pin_memory = loader.pin_memory and torch.cuda.is_available()
589 self._pin_memory_device = None
AttributeError: '_FakeLoader' object has no attribute 'pin_memory_device'
Hi
I am trying to run a dataloader .show_batch() but getting an attribute error:
Any idea of how to solve this?
Thank you
torch 2.1.1
fastai 2.1.10
torchvision 0.16.1
fastcore 1.5.29
cuda available: True, 12.1
The text was updated successfully, but these errors were encountered: