This is just an fyi - installed fastai2 on AWS:
Fastai Version: 0.0.5
Torch Version: 1.4.0
cuda: True
python version: 3.7.6 (default, Jan 8 2020, 19:59:22)
[GCC 7.3.0]
torchvision: 0.5.0
This caused the following error when testing on the planet dataset when calling show_batch()
AttributeError Traceback (most recent call last)
in
----> 1 dbunch.show_batch(max_n=9, figsize=(12,9))~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/core.py in show_batch(self, b, max_n, ctxs, show, **kwargs)
75
76 def show_batch(self, b=None, max_n=9, ctxs=None, show=True, **kwargs):
—> 77 if b is None: b = self.one_batch()
78 if not show: return self._pre_show_batch(b, max_n=max_n)
79 show_batch(*self._pre_show_batch(b, max_n=max_n), ctxs=ctxs, max_n=max_n, **kwargs)~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/load.py in one_batch(self)
128 def one_batch(self):
129 if self.n is not None and len(self)==0: raise ValueError(f’This DataLoader does not contain any batches’)
→ 130 with self.fake_l.no_multiproc(): res = first(self)
131 if hasattr(self, ‘it’): delattr(self, ‘it’)
132 return res~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/utils.py in first(x)
172 def first(x):
173 “First element ofx
, or None if missing”
→ 174 try: return next(iter(x))
175 except StopIteration: return None
176~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/load.py in iter(self)
95 self.randomize()
96 self.before_iter()
—> 97 for b in _loadersself.fake_l.num_workers==0:
98 if self.device is not None: b = to_device(b, self.device)
99 yield self.after_batch(b)~/anaconda3/envs/fastai2/lib/python3.7/site-packages/torch/utils/data/dataloader.py in init(self, loader)
374 class _SingleProcessDataLoaderIter(_BaseDataLoaderIter):
375 def init(self, loader):
→ 376 super(_SingleProcessDataLoaderIter, self).init(loader)
377 assert self._timeout == 0
378 assert self._num_workers == 0~/anaconda3/envs/fastai2/lib/python3.7/site-packages/torch/utils/data/dataloader.py in init(self, loader)
321 self._dataset = loader.dataset
322 self._dataset_kind = loader._dataset_kind
→ 323 self._IterableDataset_len_called = loader._IterableDataset_len_called
324 self._auto_collation = loader._auto_collation
325 self._drop_last = loader.drop_last~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/foundation.py in getattr(self, k)
221 attr = getattr(self,self._default,None)
222 if attr is not None: return getattr(attr, k)
→ 223 raise AttributeError(k)
224 def dir(self): return custom_dir(self, self._dir() if self._xtra is None else self._dir())
225 # def getstate(self): return self.dictAttributeError: _IterableDataset_len_called
Downgraded pytorch(on both 1.2.0 and 1.3.1) and no issues now.