google-images-dataset
google-images-dataset copied to clipboard
b should have at least 2 dimensions, but has 1 dimensions instead
Get this error when I run the code --> data.show_batch(rows=3, figsize=(7,8))
RuntimeError: b should have at least 2 dimensions, but has 1 dimensions instead
This is complete error:
RuntimeError Traceback (most recent call last)
~\Anaconda3\envs\py36\lib\site-packages\fastai\basic_data.py in show_batch(self, rows, ds_type, **kwargs)
158 def show_batch(self, rows:int=5, ds_type:DatasetType=DatasetType.Train, **kwargs)->None:
159 "Show a batch of data in ds_type
on a few rows
."
--> 160 x,y = self.one_batch(ds_type, True, True)
161 if self.train_ds.x._square_show: rows = rows ** 2
162 xs = [self.train_ds.x.reconstruct(grab_idx(x, i)) for i in range(rows)]
~\Anaconda3\envs\py36\lib\site-packages\fastai\basic_data.py in one_batch(self, ds_type, detach, denorm, cpu) 141 w = self.num_workers 142 self.num_workers = 0 --> 143 try: x,y = next(iter(dl)) 144 finally: self.num_workers = w 145 if detach: x,y = to_detach(x,cpu=cpu),to_detach(y,cpu=cpu)
~\Anaconda3\envs\py36\lib\site-packages\fastai\basic_data.py in iter(self)
68 def iter(self):
69 "Process and returns items from DataLoader
."
---> 70 for b in self.dl:
71 #y = b[1][0] if is_listy(b[1]) else b[1] # XXX: Why is this line here?
72 yield self.proc_batch(b)
~\Anaconda3\envs\py36\lib\site-packages\torch\utils\data\dataloader.py in next(self) 635 self.reorder_dict[idx] = batch 636 continue --> 637 return self._process_next_batch(batch) 638 639 next = next # Python 2 compatibility
~\Anaconda3\envs\py36\lib\site-packages\torch\utils\data\dataloader.py in _process_next_batch(self, batch) 656 self._put_indices() 657 if isinstance(batch, ExceptionWrapper): --> 658 raise batch.exc_type(batch.exc_msg) 659 return batch 660
RuntimeError: Traceback (most recent call last):
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\torch\utils\data\dataloader.py", line 138, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\torch\utils\data\dataloader.py", line 138, in