Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b should have at least 2 dimensions, but has 1 dimensions instead #2

Open
garimss opened this issue Feb 28, 2019 · 0 comments
Open

Comments

@garimss
Copy link

garimss commented Feb 28, 2019

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)
in
----> 1 data.show_batch(rows=3, figsize=(7,8))

~\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
samples = collate_fn([dataset[i] for i in batch_indices])
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\data_block.py", line 526, in getitem
x = x.apply_tfms(self.tfms, **self.tfmargs)
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\image.py", line 113, in apply_tfms
else: x = tfm(x)
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\image.py", line 499, in call
return self.tfm(x, *args, **{**self.resolved, **kwargs}) if self.do_run else x
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\image.py", line 446, in call
if args: return self.calc(*args, **kwargs)
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\image.py", line 451, in calc
if self._wrap: return getattr(x, self._wrap)(self.func, *args, **kwargs)
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\image.py", line 167, in coord
self.flow = func(self.flow, *args, **kwargs)
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\transform.py", line 238, in _symmetric_warp
return _do_perspective_warp(c, targ_pts, invert)
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\transform.py", line 225, in _do_perspective_warp
return _apply_perspective(c, _find_coeffs(_orig_pts, targ_pts))
File "C:\Users\Garima\Anaconda3\envs\py36\lib\site-packages\fastai\vision\transform.py", line 206, in _find_coeffs
return torch.gesv(B,A)[0][:,0]
RuntimeError: b should have at least 2 dimensions, but has 1 dimensions instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant